Overview Of Entity Framework

Entity Framework

ADO.NET is an old and powerful technique for accessing databases in .NET applications (desktop and web). In ADO.NET, a lot of code is used.

In simple words, you can say that all the work is manual. You have to create everything you want for your application. For automating the database technique, Microsoft has introduced Entity Framework.

 

Entity Framework is a framework that enables developers to manipulate relational data as domain-specific objects. In Entity framework, developers use queries with LINQ and manipulate the database.
 
There are two techniques for managing the data with Entity Framework.
  1. Model first

    In model first, Model class of the project is created first with ORM designer and then, classes are generated. It is useful when your database is already created. When you use model first approach, you have no need to create class as it will be created automatically.

  2. Code first 

    In code first, you have to create Model class in .cs file. You also have to create a context class for your project that is inherited by DbContext class. This class will automatically generate your database. This approach is useful when you have not already created a database, so the database is created according to Model class.