Open Visual Studio and create a new project named "MVC3EntityFrameworkDemo" using the ASP.NET MVC 3 Web Application template:
In the New ASP.NET MVC 3 Project dialog box select the Internet Application template and the Razor view engine, clear the Create a unit test project check box, and then click OK.
A few simple changes will set up the site menu, layout, and home page.
In order to set up the MVC3EntityFrameworkDemo menu, in the Views\Shared\_Layout.cshtml file, replace the existing h1 heading text and the menu links, as shown in the following example:
<body>
<divclass="page">
<divid="header">
<divid="title">
<h1>MVC3EntityFrameworkDemo</h1>
</div>
<divid="logindisplay">
@Html.Partial("_LogOnPartial")
</div>
<divid="menucontainer">
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("Students", "Index", "Student")</li>
</ul>
Getting Started with Entity Framework Code First
Introduction to POCO classes in Entity Framework
Create First MVC application in Visual Studio 2010
Creating the Entity Framework Data Model in Visual Studio
Create classes for each entity using Entity Framework
Create the Database Context using Entity Framework
Setting the Connection String in MVC Asp.Net Application
Creating a Controller and Views in MVC application
0 comments:
Post a Comment