Entity Framework in MVC with example Step By Step

Entity Framework is an Object/Relational Mapping (ORM) Framework. It is an enhancement to ADO.NET that gives developers an automated mechanism for accessing & storing the data in the database.


Most of the developer they are using ADO.Net operation to perform CRUD (Create, Select (read), Update, Delete) operations. As we know that these process are very time consuming. Because we need to write custom queries for all these operations and then need to call them by creating object of classes and dispose them properly. So that’s why Microsoft came up with new data accessing mechanism called as “Entity Framework”.

Entity Framework enables us to interact with relational data in an object-oriented way, meaning we can retrieve and manipulate data as strongly typed objects using LINQ queries. The Entity Framework’s ORM 


the implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.

We can use "Entity Framework" in three different ways:-
  1.    Entity Framework Database First Approach
  2.  Entity Framework Code First Approach
  3. Entity Framework Model First Approach



     Entity Framework Database First Approach –
In this approach, we create model codes likes classes, properties, DBContext etc. from the database in the project and those classes become the link between the database and controller. See more….

     Entity Framework Code First Approach –
In Code first approach we create POCO (Plain Old CLR Objects) is the ability to add and use your own custom data classes along with your data model. It’s also known as persistence-ignorant objects) classes and then we create the database for this POCO classes. See more….

Entity Framework Model First Approach-
In Model First approach, we need to create entities, relationships, and inheritance hierarchies directly on the design surface of EDMX and then it will generate the database from it. See more….



Entity Framework in MVC with example Step By Step Entity Framework in MVC with example Step By Step Reviewed by NEERAJ SRIVASTAVA on 2:44:00 PM Rating: 5

No comments:

Powered by Blogger.