EF Core 7 Finally Divorces Old .NET Framework
It has been quite a project to rip out the Entity Framework bits from the old, proprietary Windows-only .NET Framework and put them in its successor, the open source, cross-platform ".NET Core" scheme that became just .NET 5, .NET 6, .NET 7 and so on.
In fact, it was only last summer that we reported the dev team was still playing catch-up to the old version of EF (which stopped at version 6) in the article "EF Core 6 Dev Team Plays Catch-Up with EF6." However, while it plays catch-up, the team also introduces new goodies not to be found in the .NET Framework version.
Microsoft guidance says: "EF Core has always supported many scenarios not covered by the legacy EF6 stack, as well as being generally much higher performing. However, EF6 has likewise supported scenarios not covered by EF Core. EF7 will add support for many of these scenarios, allowing more applications to port from legacy EF6 to EF7. At the same time, we are planning a comprehensive porting guide for applications moving from legacy EF6 to EF Core."
And in the first preview release of EF Core 7.0 that was announced last week, an important milestone was reached.
"EF7 will not run on .NET Framework," said Microsoft senior program manager Jeremy Likness in a Feb. 17 blog post. (Editor's note: As mentioned by astute readers in the comments section, this is not the first release to not run on .NET Framework. I apologize for the error.)
While Entity Framework was originally part of the .NET Framework, as of Entity Framework 6 the runtime was separated from that platform, to be delivered via NuGet.
As Microsoft describes:
- Entity Framework 6 (EF6) is a tried and tested object-relational mapper (O/RM) for .NET with many years of feature development and stabilization. It is a stable, supported product but is no longer being actively developed.
- Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology. As a modern object-database mapper for .NET, it supports LINQ queries, change tracking, updates and schema migrations.
Besides not running on .NET Framework, Entity Framework 7 Preview 1 (or EF Core 7 or EF7), mostly fixed bugs and addressed issues -- more than 80, in fact.
Likness did note that EF7 now targets .NET 6, but might support .NET 7 as general availability nears in November. It will also not target any .NET Standard versions. Also, as EF6 was a long-term support (LTS) release with extended support, EF7 is a Current release that will see support for 18 months.
Going forward, Microsoft's Themes of .NET site shows what's on tap generally for EF7 as shown in the graphic above.
Also the project's high-level plan says "EF7 will contain a small number of breaking changes as we continue to evolve both EF Core and the .NET platform. Our goal is to minimize breaking changes as much as possible."
It also follows four themes:
- Highly requested features
- .NET platforms and ecosystem
- Clear path forward from EF6
That first theme, highly requested features, includes:
- JSON columns
- Bulk updates
- Lifecycle hooks
- Table-per-concrete-type (TPC) mapping
- Map CUD operations to stored procedures
- Value objects
- Support value generation when using value converters
- Raw SQL queries for unmapped types
- Database scaffolding templates
More information can be found in EF documentation and the project's GitHub repo.
David Ramel is an editor and writer for Converge360.