Announcing Entity Framework Core 6.0 Preview 6: Configure Conventions
Today, the Entity Framework Core team announces the sixth preview release of EF Core 6.0. The team continues work on the features you helped prioritize. In addition to adding new capabilities, we are closing the gap between EF Core and EF6. 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 (see the end of this blog post for details on how).
💡 Starting with preview 6, EF Core 6 targets the .NET 6 Target Framework Moniker (TFM).
A few highlights for this release include:
- Support for 64-bit identity seed values
- Support for new BCL
TimeOnlystructs for SQLite
- Uniquify and validate check constraint names
- Pre-convention model configuration
- The items on this list
This release supports pre-convention model configuration. Doing an initial discovery of the model based only on
DbSet roots was a reasonable approach when it was easy to distinguish likely scalar properties from likely navigation properties. However, as we allow more and more types to be mapped, it has become increasingly problematic to…
- Exclude a type as an entity type and therefore avoid trying to bring it and all its properties into the model
- Revert a type from being an entity type when a value converter is found or the type is ignored
This results in both bugs and additional overhead. This release, 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. For example, assume you always store string data as byte arrays. Instead of configuring every single entity, you can use the
ConfigureConventions override. It looks like this:
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
We want to hear from you! If you and/or your team are using the Entity Framework Designer (the visual editor for EDMX files in Visual Studio) we’d like to understand how you use the designer and what might be stopping you from migrating to the latest code base. Give us feedback by commenting on issue #25248.
How to get EF Core 6.0 previews
EF Core 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 6.0.0-preview.6.21352.1
This following table links to the preview 6 versions of the EF Core 6.0 packages and describes what they are used for.
|The main EF Core package that is independent of specific database providers
|Database provider for Microsoft SQL Server and SQL Azure
|SQL Server support for spatial types
|Database provider for SQLite that includes the native binary for the database engine
|Database provider for SQLite without a packaged native binary
|SQLite support for spatial types
|Database provider for Azure Cosmos DB
|The in-memory database provider
|EF Core PowerShell commands for the Visual Studio Package Manager Console; use this to integrate tools like scaffolding and migrations with Visual Studio
|Shared design-time components for EF Core tools
|Lazy-loading and change-tracking proxies
|Decoupled EF Core abstractions; use this for features like extended data annotations defined by EF Core
|Shared EF Core components for relational database providers
|C# analyzers for EF Core
Thank you from the team
A big thank you from the EF team to everyone who has used EF over the years!
Thank you to our contributors!
We are grateful to our amazing community of contributors. Our success is founded upon the shoulders of your efforts and feedback. If you are interested in contributing but not sure how or would like help, please reach out to us! We want to help you succeed. We would like to publicly acknowledge and thank these contributors for investing in the success of EF Core 6.0.