News

Microsoft Takes Entity Framework 6 to .NET Core

Microsoft announced Entity Framework 6.3 Preview, which takes the traditional open source object-relational mapping (ORM) framework to the .NET Core space, joining Entity Framework Core as an option for leveraging the upcoming .NET Core 3.0.

The preview is another part of the company's wholesale shift to the open source, cross-platform approach provided by "Core" offerings, supplanting the traditional, 17-year-old Windows-based .NET Framework scheme.

While Entity Framework was originally part of that .NET Framework, as of Entity Framework 6 the runtime was separated from that platform. Now, with the EF 6.3 preview, Microsoft is taking the first steps to help Microsoft-centric data developers move their applications to the new Core order.

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.
  • Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology.

The company is working toward a unified offering that ties everything together under the .NET 5 moniker, due next year.

In the meantime, products are moving to .NET Core piecemeal.

"While Entity Framework Core was built from the ground up to work on .NET Core, 6.3 will be the first version of EF 6 that can run on .NET Core and work cross-platform," said Diego Vega, program manager, .NET Data Access, in a blog post last week. "In fact, the main goal of this release is to facilitate migrating existing applications that use EF 6 to .NET Core 3.0."

As a first effort in that direction, the preview has some "major limitations," Vega said, listing those as:

  • Migration commands cannot be executed on projects not targeting .NET Framework.
  • There is no EF designer support for projects not targeting .NET Framework.
  • There is no support for building and running with models based on EDMX files on .NET Core. On .NET Framework, this depends on a build task that splits and embeds the contents of the EDMX file into the final executable file, and that task is not available for .NET Core.
  • Running code first projects in .NET Core is easier but still requires additional steps, like registering DbProviderFactories programmatically, and either passing the connection string explicitly, or setting up a DbConnectionFactory in a DbConfiguration.
  • Only the SQL Server provider, based on System.Data.SqlClient, works on .NET Core. Other EF6 providers with support for .NET Core haven’t been released yet.

Regarding the EDMX-related limitation -- a concern of several developers who commented on the post -- Vega said it was a temporary limitation expected to be removed by the time the final product ships.

In response to another question, he clarified the company's positioning on the alternative offerings: "This post is about the next minor version of EF6, that now happens to also run on .NET Core. EF Core and EF6 remain two different products, and nothing else has changed."

In addition to the preview limitations detailed above, longer-term limitations listed by Vega include:

  • We have no plans to support the SQL Server Compact provider on .NET Core. There is no ADO.NET provider for SQL Server Compact on .NET Core.
  • SQL Server spatial types and HierarchyID aren’t available on .NET Core.

As Microsoft works out the kinks in the v6.3 preview, it aims to eventually support:

  • NuGet PackageReferences (this implies working smoothly without any EF entries in application config files)
  • Migration commands running on projects using the new .NET project system

Vega provided getting-started advice in his post and pointed to the project's issue tracker for further information on bug fixes and more.

The preview is available via NuGet.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events