Entity Framework Core 2.1 Announced

Recently, Microsoft has announced the release of Entity Framework Core 2.1 which is the latest production-ready release of the open-source and cross-platform data access technology.

Recently, Microsoft has announced the release of Entity Framework Core 2.1 which is the latest production-ready release of the open-source and cross-platform data access technology.
 
The company has fixed more than 500 bugs and done enhancements from the release of EF Core 2.0.
 
The company has released a list of significantly improved features -
  • Lazy loading - EF Core now contains the necessary building blocks for anyone to author entity classes that can load their navigation properties on demand.

  • Parameters in entity constructors - You can use parameters to inject property values, lazy loading delegates, and services.

  • Value conversions - Starting with EF Core 2.1, value conversions can be applied to transform the values obtained from columns before they are applied to properties, and vice-versa.

  • LINQ GroupBy translation - Microsoft now supports translating it to the SQL GROUP BY clause in most common cases.

  • Data Seeding - With the new release it will be possible to provide initial data to populate a database.

  • Query types - An EF Core model can now include query types. Unlike entity types, query types do not have keys defined on them and cannot be inserted, deleted or updated (i.e. they are read-only), but they can be returned directly by queries.
     
  • Include for derived types - It will be now possible to specify navigation properties only defined on derived types when writing expressions for the Include method.
     
  • Optimization of correlated sub-queries - Microsoft has improved our query translation to avoid executing “N + 1” SQL queries in many common scenarios in which the use of a navigation property in the projection leads to joining data from the root query with data from a correlated sub-query.
 
There is a long list of useful features shared by Microsoft, which can be read from the official announcement