Code-First Approach With ASP.NET MVC Framework

In this article, we’ll learn how to perform CRUD operations with a code first approach in an MVC application. Here, we will create an MVC structure that will help to change in the Model Class and that change will update it in the database. Microsoft’s Entity Framework (EF) avoids working directly with the database and creates the database per the model classes’ requirements. We will not use visual model designer (EDMX) completely but will create POCO classes first and then create the database from these POCO classes.
Recommended Prerequisites

Visual Studio 2010 SP1
SQL Server

Step 1
Open Visual Studio and select “File” >> “New". Then click on Project (remember, don’t go with the option ‘File->New->Website’).