Database Reference
In-Depth Information
Figure 4-1. A model with a Category entity that contains an application's category name and description
The model contains a Category entity. You want to create a few simple ASP.NET MVC pages to show the list of all
of the app categories. You also want to allow the user to create a new app category, update an existing app category,
and delete an app category. Although there are number of ways to do this, we will do it in a very simple way to build
your understanding of the integration of Entity Framework with ASP.NET MVC. To create an MVC application,
you will need three parts: a model, a controller, and a view. We have used the file MyStore .mdf as our database for
this recipe. We are also using the Razor engine for all of the views. There is only one model but with multiple views,
depending on the actions or operations required. In this case, we will have four views: one each for Create, Update,
Delete, and List.
First we will create an ASP.NET MVC 4 Web Application using the project template Internet Application ,
as demonstrated in Figure 4-2 and Figure 4-3 .
Figure 4-2. Selecting an ASP.NET MVC Web Application project in Visual Studio 2012
 
Search WWH ::




Custom Search