Introduction: What is Entity Framework Core?
Entity Framework Core is an evolution of Microsoft's object-relational mapper, which has been around since 2000. It is also known as EF Core. EF Core is Microsoft's official cross-platform data access framework for .NET Development. EF Core is a very powerful ORM ( object-relational mapping ).
EF Core enhances developer productivity. EF Core has a mapping layer in between, allowing the table from an object. EF Core allows us to connect with many databases engines.
What is ORM?
ORM (object-relational mapping) allows us to express our database queries using our application classes, then ORM builds and executes SQL queries for us. In other words, the breakup of ORM means as given below:
- The Object part is the one we use with our programming language ( C# or Java ).
- The Relational part is a Relational Database Management System ( RDBMS ) some most popular RDBMS are Oracle, MS-SQLServer, MySQL, PostgresSQL.
- And the Mapping part is where we make a bridge between our objects and our database tables.
Hence ORM allows us to store, update and delete data into the database.
Entity Framework Core Supported Databases.
Entity Framework Core is used in many different databases by using plugins (from NuGet) called database providers. Below list of some different database providers
|Package Name||Database Engine||Maintainer|
|Microsoft.EntityFrameworkCore.SqlServer||SQL Server 2012 and above||Microsoft|
|Microsoft.EntityFrameworkCore.Sqlite||SQLite 3.7 and above||Microsoft|
|Npgsql.EntityFrameworkCore.PostgreSQL||PostgreSQL||Npgsql Development Team|
|Pomelo.EntityFrameworkCore.MySql||MySQL, MariaDB||Pomelo Foundation|
There are many more other database providers, but I have listed those that are very popular database engines.
EF Core Supported Application Types
- ASP.NET Web Forms (framework 4.5+)
- ASP.NET MVC
- ASP.NET Core (MVC / Razor Pages)
- Web API
- Console Application
- Windows Application
- Xamarin Framework
Entity Framework Core Development Approach
EF Core supports 2 development approaches and that is:
- Code First Approach.
- Database First Approach.
Code First Approach, means when we develop the application, we write our application object code first before we write database code. In short, we first create domain classes in our application, and then with EF Core magic, it creates the database and all tables using migration based on our application domain classes. This approach is also called Data-Driven Design.
Whereas in Database First Approach, EF Core creates domain and context classes in our application from the given existing database. Till now EF Core has limited support for the database first approach i.e there is no visual designer support like the .edmx file.
We will understand both these approaches in more depth in our further article on Entity Framework Core.
PS: If you found this content valuable and want to thank me? 👳 Buy Me a Coffee