Introduction To Entity Framework And Entity Framework Core

What is EF (Entity Framework)?

Entity Framework is the latest technology provided by ADO.NET for accessing the database.
  • It is an O/RM tool (Object Relation Mapping)
  • It provides an easy and automated way of mapping between Objects (Classes) and Relations (Tables)
  • It auto-generates most of the data-access code.

 Why Use O/RM?

It provides full IntelliSense support for columns names and table names. (Strongly Typed)

What is EF (Entity Framework) Core?

  • Entity Framework Core is an O/RM tool.
  • Entity Framework Core is the latest data access technology for .Net developers.
  • Entity Framework Core has almost the same interface as EF6.X.
  • Entity Framework Core can be used to access NoSQL DB. Whereas EF6.X cannot.
  • Entity Framework Core can run on Windows, Linux, and Apple. Whereas EF6.X is only for Windows.

There are two approaches of working with EF Core,

  1. Code-First
  2. Database-First

As per our old EF, we are using both the approaches that first create classes, then you run it or compile it. It will create the database automatically. And the second approach first creates the database then create classes as per the database.

But with EF Core it directly supports Code-First. It doesn't support the Database-First approach directly due to some "Reverse Engineering", it needs some extra task to go for Reverse Engineering or the Database-First approach. So, you have to go with the Code-First approach so that first, you create code, then it will create a database directly using that code.