News

EF Core 6 Dev Team Plays Catch-Up with EF6

In announcing the sixth preview release of EF Core 6.0, Microsoft noted the dev team for the open source, cross-platform data development framework is still playing catch-up with EF6, the traditional object-relational mapping (ORM) framework formerly tied to the Windows-only .NET Framework.

While Entity Framework was originally part of that .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.

Earlier this month, in announcing new EF 6 Core capabilities introduced in .NET 6 Preview 6, Microsoft's Jeremy Likness reported on the EF Core 6 team's progress in providing equivalent functionality to EF6.

"In addition to adding new capabilities, we are closing the gap between EF Core and EF6," Likness said. "Issue #24106 shares details about the differences and our roadmap to eliminate it. We are making progress on features like migrations bundles and implicit ownership in the Azure Cosmos DB provider but are not quite ready for you to test them yet. However, many updates are available right now when you download preview 6."

That GitHub issue he mentioned, to "Narrow the feature gap between EF Core and EF6," says there are still some scenarios supported on EF6 that aren't supported on EF Core, so to ease the transition from EF6 to EF Core the team plans to close that gap as much as possible, although, by design, some scenarios will not be supported. Those scenarios being worked on include:

Narrow the feature gap between EF Core and EF6
[Click on image for larger view.] 'Narrow the feature gap between EF Core and EF6' (source: Microsoft).

A full comparison of EF Core and EF6 shows all the differences. One area of special focus is data querying, as the "Plan for EF Core 6.0" says: "We plan to close the query gap to EF6 and make supported EF Core queries a true superset of supported EF6 queries." Regarding data querying, the comparison shows this:

Feature Comparison
[Click on image for larger view.] Feature Comparison (source: Microsoft).

As for new features introduced earlier this month as part of EF Core 6.0 Preview 6, Likness pointed out pre-convention model configuration. He said that doing an initial discovery of a model based only on DbSet roots reasonable when it was easy to distinguish likely scalar properties from likely navigation properties, but that approach became increasingly problematic as more types were mapped. For that reason, "We focused on finding ways to enhance model building so that it can more efficiently figure out what is an entity type and what is not."

Other highlights of Preview 6 include:

  • Support for 64-bit identity seed values
  • Support for new BCL DateOnly and TimeOnly structs for SQLite
  • Uniquify and validate check constraint names

When a reader asked when there will be support of DateOnly and TimeOnly for SQL Server, another reader advised him to "Upvote dotnet/SqlClient#1009 to let 'em know it's important to you."

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube