Here we will learn about the basic CRUD workflow using Entity Framework.
Let's understand the above EF workflow:
1. First we need to define our model. Defining the model may includes defining our domain classes, context class derived from DbContext, and configurations if any exits. EF will perform CRUD operations based on our model.
2. To insert data, add a domain object to a context and then call the SaveChanges() method. Entity Framework API will build on an appropriate INSERT command and which execute it on the database.
3. To read data, first execute the LINQ-to-Entities query in our preferred language (C#/VB.NET). EF API will then convert this query into SQL query for the underlying relational database and finally execute it. The result will be transformed into domain that is entity objects and displayed on the UI.
4. To edit or delete data also update or remove entity objects from a context and call the SaveChanges() method. EF API will build on the appropriate UPDATE or DELETE command and execute it on the database.
Liked By
Write Answer
Describe basic workflow for entity framework?
Join MindStick Community
You have need login or register for voting of answers or question.
Nishi Tiwari
29-Jan-2020Basic Workflow in Entity Framework
Here we will learn about the basic CRUD workflow using Entity Framework.
Let's understand the above EF workflow:
1. First we need to define our model. Defining the model may includes defining our domain classes, context class derived from DbContext, and configurations if any exits. EF will perform CRUD operations based on our model.
2. To insert data, add a domain object to a context and then call the SaveChanges() method. Entity Framework API will build on an appropriate INSERT command and which execute it on the database.
3. To read data, first execute the LINQ-to-Entities query in our preferred language (C#/VB.NET). EF API will then convert this query into SQL query for the underlying relational database and finally execute it. The result will be transformed into domain that is entity objects and displayed on the UI.
4. To edit or delete data also update or remove entity objects from a context and call the SaveChanges() method. EF API will build on the appropriate UPDATE or DELETE command and execute it on the database.