Introduction
The Plan for Entity Framework Core 5.0 is already announced, but It is important to know that this is not the final plan, and this agenda may vary.

One of the important notes about is that EF Core 5.0 does not support .NET Framework. So, I recommend you do avoid using .Net Framework for the new projects. .NET Framework should only be used in the legacy projects if required. The other important news is that EF Core 5.0 will contain some breaking changes, especially around TPT support.
Proposals and Bug Fixes
Many-to-many navigation properties (a.k.a "skip navigations")
This feature helps to avoid the overhead in the Many-to-many navigation properties the syntax.
Example
- public class Customer
- {
- /// <summary>Gets or sets the customer identifier.</summary>
- /// <value>The product inventory identifier.</value>
- public long CustomerId { get; set; }
- /// <summary>Gets or sets the name.</summary>
- /// <value>The name.</value>
- public string Name { get; set; }
- /// <summary> Gets or sets the address. </summary>
- /// <value> The address. </value>
- public string Address { get; set; }
- /// <summary>Gets or sets the create date.</summary>
- /// <value>The create date.</value>
- public DateTimeOffset CreateDate { get; set; }
- /// <summary> Gets or sets the customerProducts. </summary>
- /// <value> The products. </value>
- public ICollection<CustomerProduct> CustomerProducts { get; set; }
- }
- public class Product
- {
- /// <summary>Gets or sets the product identifier.</summary>
- /// <value>The product inventory identifier.</value>
- public long ProductId { get; set; }
- /// <summary>Gets or sets the name.</summary>
- /// <value>The name.</value>
- public string Name { get; set; }
- /// <summary>Gets or sets the description.</summary>
- /// <value>The description.</value>
- public string Description { get; set; }
- /// <summary>Gets or sets the create date.</summary>
- /// <value>The create date.</value>
- public DateTimeOffset CreateDate { get; set; }
- /// <summary> Gets or sets the customerProducts. </summary>
- /// <value> The customers. </value>
- public ICollection<CustomerProduct> CustomerProducts { get; set; }
- }
Many-to-many navigation properties In EF Core 3
- var customers
- = shopDbContext.Customers
- .Include(e => e.CustomerProducts)
- .ThenInclude(e => e.Product)
- .ToList();
- var playStationFiveCustomers
- = shopDbContext.Customers
- .Where(e => e.CustomerProducts.Select(customerProduct => customerProduct.Product.Name)
- .Contains("PlayStation 5")).ToList();
The proposal to solve the problem:
- public class Customer
- {
- /// <summary>Gets or sets the customer identifier.</summary>
- /// <value>The product inventory identifier.</value>
- public long CustomerId { get; set; }
- /// <summary>Gets or sets the name.</summary>
- /// <value>The name.</value>
- public string Name { get; set; }
- /// <summary> Gets or sets the address. </summary>
- /// <value> The address. </value>
- public string Address { get; set; }
- /// <summary>Gets or sets the create date.</summary>
- /// <value>The create date.</value>
- public DateTimeOffset CreateDate { get; set; }
- /// <summary> Gets or sets the products. </summary>
- /// <value> The product. </value>
- public ICollection<Product> Products { get; set; } // Help you to Skips over CustomerProduct to Product
- /// <summary> Gets or sets the customerProducts. </summary>
- /// <value> The products. </value>
- public ICollection<CustomerProduct> CustomerProducts { get; set; }
- }
- public class Product
- {
- /// <summary>Gets or sets the product identifier.</summary>
- /// <value>The product inventory identifier.</value>
- public long ProductId { get; set; }
- /// <summary>Gets or sets the name.</summary>
- /// <value>The name.</value>
- public string Name { get; set; }
- /// <summary>Gets or sets the description.</summary>
- /// <value>The description.</value>
- public string Description { get; set; }
- /// <summary>Gets or sets the create date.</summary>
- /// <value>The create date.</value>
- public DateTimeOffset CreateDate { get; set; }
- /// <summary> Gets or sets the customers. </summary>
- /// <value> The customers. </value>
- public ICollection<Customer> Customers { get; set; } // Help you to skips over CustomerProduct to Customer
- /// <summary> Gets or sets the customerProducts. </summary>
- /// <value> The customers. </value>
- public ICollection<CustomerProduct> CustomerProducts { get; set; }
- }
Many-to-many navigation properties In EF Core 5.0
- var postsAndTags
- = shopDbContext.Customers
- .Include(e => e.Products)
- .ToList();
- var post
- = shopDbContext.Customers
- .Where(e => e.Products.Select(e => e.Name).Contains("PlayStation 5")).ToList();
Table-per-type (TPT) inheritance mapping
Officially, EF Core is not supporting Table-per-Type (TPT), because of TPT can easily be misused and causes performance issues. DDD developers working differently. They are creating domain models in Bounded Contexts. So that means they do not have this one big monolithic domain model and a lot of joins that are coming from the Includes. TPT will add some overhead and joins to the queries, but the DDD developers can handle this problem effectively. For this reason, a lot of DDD developers found that TPT is very useful, and that makes the customization very easy and flexible. EF Core Team has decided to add this feature to EF Core 5.0.
"Even if TPT is considered slow, it is a boon for many real-world business scenarios. If implemented properly and well thought of, TPT is not slow for a given need in most of the cases".
If possible, optimization can be done to TPT.
But its a very important feature for EF to be accepted for developing DDD applications.
The other method, Composition over Inheritance does not look viable since we cannot use interface property to create our model. Binding to a concrete type takes away the flexibility to customize the models. TPT makes the customization very easy and flexible.
We are doing TPT because it is both a highly requested feature (~254 votes; 3rd overall) and because it requires some low-level changes that we feel are appropriate for the foundational nature of the overall .NET 5 plan. We expect this to result in breaking changes for database providers, although these should be much less severe than the changes required for 3.0".
Filtered Include
Global query filters are useful in many use cases, but sometimes you need more control about the filter.
This feature to specify allows filters on Include on a per-query basis.
“Filtered Include is a highly-requested feature (~317 votes; 2nd overall) that isn't a huge amount of work, and that we believe will unblock or make easier many scenarios that currently require model-level filters or more complex queries”.
Currently, Doing a .Where() inside a .Include() is allowed (by the syntax, it fails in execution):

Join the conversation! Your thoughts help the community grow.