Entity Framework has evolved a lot since its launch in 2008, so we will briefly look at its history.
Each version has introduced improvements, especially in terms of optimization, performance, and database compatibility.
To make the topic more “confusing,” Entity Framework also has two main versions: EF6 and EF Core.
- Entity Framework 6: It is the classic version of Entity Framework, designed for .NET Framework.
- Entity Framework Core: It is the modern and lightweight version of Entity Framework, designed for .NET 5+ (or later).
If you have ever used Entity Framework (without Core), they are not related.
They share the name and have similarities in their working methods, but EF Core is much more modern and faster.
Comparison of EF and EF Core
We start by looking at the comparison between EF and EF Core.
Feature | Entity Framework | Entity Framework Core |
---|---|---|
Platform Compatibility | 🟠Only Windows | 🟢Cross-platform |
.NET | .NET Framework | .NET 5+ |
Performance | 🔴Less optimized | 🟢Much better |
Migrations | 🟠Yes, but less flexible | 🟢Yes |
Supported Databases | 🟠SQL Server | 🟢Multiple databases |
Entity Framework is the old version. Version 6 is the last version (released in 2013) and has remained the main option for .NET Framework applications.
EF6 is compatible only with .NET Framework and does not work on .NET Core or .NET 5/6/7+.
It is a mature product with stability. EF6 has been widely tested and used in enterprise projects.
Long-term support: Although EF6 no longer receives new features, it continues to receive security updates and bug fixes.
Entity Framework Core is the modern version. It was released in 2016 alongside .NET Core and is the recommended option for modern applications.
A complete rewrite of Entity Framework, designed to be lighter, modular, and compatible with the new versions of .NET.
EF Core is compatible with .NET Core, .NET 5+, and .NET Framework (although with some limitations on the latter).
- Cross-platform compatibility: EF Core runs on Windows, Linux, and macOS.
- Multi-database support, even for non-relational databases
- EF Core is designed to be more lightweight and modular, allowing you to include only the necessary functionalities.
- New features: EF Core introduces modern functionalities like Global Query Filters, Temporal Tables,
- Improved support for migrations
In this course, we will focus on .NET Entity Framework Core (even when Core is not explicitly mentioned)