February 17th, 2022

Announcing Entity Framework 7 Preview 1

Jeremy Likness
Principal Program Manager - .NET Web Frameworks

Today, the .NET data team announces the first preview release of EF Core 7.0 (EF7). This release contains mostly bug fixes and foundation work for larger features that will land in later previews. Be sure to read the full plan for EF7 to learn what’s on the roadmap.

Prerequisites

  • EF7 currently targets .NET 6. This will likely be updated to .NET 7 as we near the release.
  • EF7 will not run on .NET Framework.

EF7 is the successor to EF Core 6.0, not to be confused with EF6. If you are considering upgrading from EF6, please read our guide to port from EF6 to EF Core.


How to get EF7 previews

EF7 is distributed exclusively as a set of NuGet packages. For example, to add the SQL Server provider to your project, you can use the following command using the dotnet tool:

dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 7.0.0-preview.1.22076.6

This following table links to the preview 1 versions of the EF Core packages and describes what they are used for.

Package Purpose
Microsoft.EntityFrameworkCore The main EF Core package that is independent of specific database providers
Microsoft.EntityFrameworkCore.SqlServer Database provider for Microsoft SQL Server and SQL Azure
Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite SQL Server support for spatial types
Microsoft.EntityFrameworkCore.Sqlite Database provider for SQLite that includes the native binary for the database engine
Microsoft.EntityFrameworkCore.Sqlite.Core Database provider for SQLite without a packaged native binary
Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite SQLite support for spatial types
Microsoft.EntityFrameworkCore.Cosmos Database provider for Azure Cosmos DB
Microsoft.EntityFrameworkCore.InMemory The in-memory database provider
Microsoft.EntityFrameworkCore.Tools EF Core PowerShell commands for the Visual Studio Package Manager Console; use this to integrate tools like scaffolding and migrations with Visual Studio
Microsoft.EntityFrameworkCore.Design Shared design-time components for EF Core tools
Microsoft.EntityFrameworkCore.Proxies Lazy-loading and change-tracking proxies
Microsoft.EntityFrameworkCore.Abstractions Decoupled EF Core abstractions; use this for features like extended data annotations defined by EF Core
Microsoft.EntityFrameworkCore.Relational Shared EF Core components for relational database providers
Microsoft.EntityFrameworkCore.Analyzers C# analyzers for EF Core

We also published the 7.0 preview 1 release of the Microsoft.Data.Sqlite provider for ADO.NET.

Installing the EF7 Command Line Interface (CLI)

Before you can execute EF7 Core migration or scaffolding commands, you’ll have to install the CLI package as either a global or local tool.

To install the preview tool globally, install with:

dotnet tool install --global dotnet-ef --version 7.0.0-preview.1.22076.6

If you already have the tool installed, you can upgrade it with the following command:

dotnet tool update --global dotnet-ef --version 7.0.0-preview.1.22076.6

It’s possible to use this new version of the EF7 CLI with projects that use older versions of the EF Core runtime.


What’s new in EF7 Preview 1

The list of issues that are addressed in preview 1 is available on GitHub. There are over 80 issues addressed. We’d like to extend a special thanks to our community contributors to this preview, including:

Daily builds

EF7 previews are aligned with .NET 7 previews. These previews tend to lag behind the latest work on EF7. Consider using the daily builds instead to get the most up-to-date EF7 features and bug fixes.

As with the previews, the daily builds require .NET 6.

The .NET Data Community Standup

The .NET data team is now live streaming every other Wednesday at 10am Pacific Time, 1pm Eastern Time, or 17:00 UTC. Join the stream to ask questions about the data-related topic of your choice, including the latest preview release.

Documentation and feedback

The starting point for all EF Core documentation is docs.microsoft.com/ef/.

Please file issues found and any other feedback on the dotnet/efcore GitHub repo.

Helpful links

The following links are provided for easy reference and access.

EF Core Community Standup Playlist:

https://aka.ms/efstandups

Main documentation:

https://aka.ms/efdocs

Issues and feature requests for EF Core:

https://aka.ms/efcorefeedback

Entity Framework Roadmap:

https://aka.ms/efroadmap

Bi-weekly updates: https://github.com/dotnet/efcore/issues/27185

Thank you from the team

A big thank you from the EF team to everyone who has used and contributed to EF over the years!

Welcome to EF7.

Author

Jeremy Likness
Principal Program Manager - .NET Web Frameworks

Jeremy is a Principal Program Manager for .NET Web Frameworks at Microsoft. Jeremy wrote his first program in 1982, was recognized in the "who's who in Quake" list for programming the first implementation of "Midnight Capture the Flag" in Quake C and has been developing enterprise applications for 25 years with a primary focus on web-based delivery of line of business applications. Jeremy is the author of four technology books, a former 8-year Microsoft MVP for Developer Tools and Technologies, ...

More about author

12 comments

Discussion is closed. Login to edit/delete existing comments.

  • Stuart Ballard

    Are there any plans to address this issue - I don't think it's technically a "bug" but it's certainly unexpected behavior and I haven't found any workarounds that don't feel ugly. The issue is that it doesn't seem like you can create a boolean field that defaults to true in the database, because on insert, if the model object's boolean fields is 'false' EF assumes it's unchanged and skips it, even if the model knows...

    Read more
    • Kenzo De Ridder

      For booleans, when you scaffold the database, it generates a bool? type and even says in the output that it’s doing that so it can detect the default True value on Inserts, even though the DB type isn’t nullable.
      Maybe you are using a code first model, without the nullable boolean? In that case, EF indeed won’t know you want a default true value unless you explicitly set it.
      So sounds more like a configuration...

      Read more
    • Jeremy LiknessMicrosoft employee Author · Edited

      Have you filed an issue or is there an existing one to refer to? Do you have a repro? On insert, it should insert whatever value is set. On update, it should update any values that are different.

  • Frolov Sergey

    When will MySQL support?

  • Alishoooo Esteres · Edited

    Please support of NoSQL (like mongodb) in entity framework

    • Jeremy LiknessMicrosoft employee Author

      Hi, thanks for your request. Can you share some of the reasons you would prefer an EF approach over the native MongoDB SDK?

  • MgSam

    Please do not make EF7 require .NET 7. You should at minimum use LTS releases as your lowest supported .NET version.

    • Jeremy LiknessMicrosoft employee Author

      Thanks, we take all feedback into account. Keep in mind that the EF support follows the .NET, so EF7 will be supported as “Current” and not “LTS” regardless of whether it targets .NET 7.

      • MgSam

        That’s fine, but updating .NET every single year is a much more costly proposition than updating to a new version of EF. Targeting the lowest version possible ensures the most people can benefit from EF.

      • Jon Miller

        That’s why you are better off sticking with .NET Framework, Dapper, and avoiding EF Core altogether. They will drop support on you. Just like they did for .NET Framework.