Entity Framework - SPLessons

Entity Framework Model First Approach

Home > Lesson > Chapter 6
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Entity Framework Model First Approach

Entity Framework Model First Approach

shape Introduction

In Model First Approach, one need to create an Entity Model. If don't know about the Entity Model Creation o through the "Creation of Entity Framework" which is the previous article.

shape Step-1

Based on the Entities created earlier, SQL commands can be created. Follow the below steps to work with Model First Approach.
  • Open a New Project as shown in the below figure.

shape Step-2

  • Then, a new window will open. Select Visual C# ->Windows -> Console Application->Give the Name as per requirement and click on OK as shown in the below figure.
  • Now, the project will be created as shown in the below figure.

shape Step-3

  • Go to Solution Explorer->Right click on the Project->Add ->New Item as shown in the below figure.

shape Step-4

  • Then, a new window will opened as shown in the below figure. Select Data->ADO.NET Entity Model->Give the Name as required and click on Add as marked in the below figure.

shape Step-5

  • Then, the following window will be opened. Select the Empty Model and click on Finish as shown in the following figure.
  • The diagram will be generated as shown below.

shape Step-6

  • Right click on the empty space. Click on Add->Entity as shown in the below figure.