BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Releases Entity Framework Core 5.0 RC 1

Microsoft Releases Entity Framework Core 5.0 RC 1

This item in japanese

Last week, Microsoft released Entity Framework Core 5.0 RC1, the first "go live" release of the framework before its official debut in November, together with .NET 5. EF Core is an object-database mapper for .NET, allowing developers to work with a database using .NET objects.

This release candidate contains all features planned for EF Core 5.0. The new features include fully transparent many-to-many mapping, table-per-type inheritance, entity-to-query mapping, support to filtered and split includes, required one-to-one dependents, general query enhancements, and overall improvements in performance, migrations, and deployment experience.

Many-to-many is the most requested feature on EF Core's backlog. EF Core 5.0 now supports many-to-many relationships without explicitly mapping the join table: when Migrations (or EnsureCreated) are used to create the database, the join table is automatically created.

Property-bag entity types are also part of the many-to-many improvements, allowing a standard CLR type to be used for entity instances such that an explicit CLR type is not needed for each entity type. With this feature, a Dictionary can be used as an entity type - and ultimately as a shared-type entity type, mapped to multiple different entity types.

Another critical feature in the new version is table-per-type (TPT) mapping, which uses a separate table in the database to maintain data for each entity type in an inheritance hierarchy. This particular issue was opened as "a very important feature for EF to be accepted for developing DDD applications," and it is available since EF Core 5.0 Preview 8.

Filtered and Split includes were also two of the highest voted issues in the backlog. Filtered includes is one of the oldest issues addressed in this release, dated from 2015. It refers to the ability to specify filters inline when executing a database inclusion. Split includes refer to a performance issue introduced in EF Core 3.0 when the default behavior was changed to create a single SQL query for a given LINQ query. This change caused performance issues for queries that use Include for multiple collections. In EF Core 5.0, it is now possible to generate multiple queries for collection Includes where having a single query is causing bad performance.

Other significant changes in EF Core 5.0 include the option of configuring a one-to-one dependent as required, major performance improvements in the Npgsql provider, and multiple improvements related to migrations and deployment experience. The only feature originally planned cut from the november release is the architectural/contributor documentation, aimed at making it easier for contributors to understand the internals of EF Core. The detailed list of all EF Core 5.0 features can be found here, and all breaking changes can be found here.

It is important to note that EF Core 5.0 runs only on platforms that support .NET Standard 2.1. While this requisite excludes .NET Framework from the supported platforms, it also means that  EF Core 5.0 will run on .NET Core 3.1, not necessarily requiring .NET 5. EF Core is distributed exclusively as a set of NuGet packages. All links to each of the EF Core 5.0 packages can be found in the original release post.

Rate this Article

Adoption
Style

BT