PizzaShack is a Visual Studio 2015 solution composed out of an MVC project and a unit test project. It is meant to display various ways of implementing most basic web app functionality.
PizzaShack is a basic web app that allows you to create pizza orders, view them, and update their status.
- PizzaShack MVC project with a bit of everything (forms, AJAX, DI, data access etc.)
- PizzaShackTests project with unit/integration tests
- ASP.NET MVC 5 http://www.asp.net/mvc
- Entity Framework (data access) https://msdn.microsoft.com/en-us/data/ef.aspx
- Attribute Routing http://www.asp.net/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2
- Unity.Mvc5 (dependency injection) https://github.com/devtrends/Unity.Mvc5
- MOQ (mocking library for testing) https://github.com/moq/moq4
- Form POST
- AJAX POST
- Create, Read, and Update operations
- ADO.NET Data Model created from Database https://msdn.microsoft.com/en-us/data/jj206878.aspx
- Custom Repository Pattern https://msdn.microsoft.com/en-us/library/ff649690.aspx
- ASP.NET Razor basic templates https://en.wikipedia.org/wiki/ASP.NET_Razor
- Publish script for Azure App Service
- Datasource for Azure SQL Database
- jQuery DataTable
By no means this is to be treated as the best way to code. The goal of this project was to demonstrate how certain things can be accomplished.
-
Pull solution.
-
Open in Visual Studio 2013/2015.
-
Edit PizzaShack.pubxml file (Solution > PizzaShack > Properties > PublishProfiles) and update the following:
-
<MSDeployServiceURL>{AZURE_URL}</MSDeployServiceURL>
-
<Destination Path="Data Source={SERVER};Initial Catalog={SERVER_DATABASE};Persist Security Info=True;User ID={USER_NAME};Password={PASSWORD};Application Name=EntityFramework" Name="Data Source={SERVER};Initial Catalog={SERVER_DATABASE};Persist Security Info=True;User ID={USER_NAME};Password={PASSWORD};MultipleActiveResultSets=True;Application Name=EntityFramework" />
-
<ParameterValue>metadata=res://*/Models.Pizza.csdl|res://*/Models.Pizza.ssdl|res://*/Models.Pizza.msl;provider=System.Data.SqlClient;provider connection string="Data Source={SERVER};Initial Catalog={SERVER_DATABASE};Persist Security Info=True;User ID={USER_NAME};Password={PASSWORD};MultipleActiveResultSets=True;Application Name=EntityFramework"</ParameterValue>
-
Edit Web.config file (Solution > PizzaShack) and update the following:
-
<add name="Entities" connectionString="metadata=res://*/Models.Pizza.csdl|res://*/Models.Pizza.ssdl|res://*/Models.Pizza.msl;provider=System.Data.SqlClient;provider connection string="data source={SERVER};initial catalog={SERVER_DATABASE};persist security info=True;user id={USER_NAME};password={PASSWORD};MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /></connectionStrings>
-
Once your data source and publish credentials are set, you can run the SQL statements located in Solution > PizzaShack > SQL > tables.sql file.
-
You should be ready to go. Run the project.