|Entity Framework Core 2 Released With Drawbacks|
|Written by Kay Ewbank|
|Thursday, 24 August 2017|
Microsoft has released the final version of Entity Framework Core 2.0, alongside .NET Core 2.0 and ASP.NET Core 2.0. Entity Framework (EF) Core is the lightweight cross-platform version of Entity Framework, the Object/Relational Mapping (O/RM) framework for .NET.
The positive aspects of EF Core include a more efficient and robust LINQ implementation, and a simplified provider model along with its utilization of DI. EF Core now targets the new .NET Standard 2.0.
The LINQ implementation improvements start with better handling of sub-queries, which are no longer nested unnecessarily. Queries are also less likely to switch prematurely to client-side evaluation, and LINQ no longer retrieves all the columns of a table when only a few were requested.
A new EF.Functions property has been introduced. This can be used to map operators to database functions or operators, and then have them invoked in LINQ queries. This version adds the Like() operator, so you can use
Global query filters are another improvement. You can now specify filters in the model that are applied automatically to all entities of a type in all queries executed on the
However, some improvements that users of EF Core have been hoping for are still missing. SQL generation is still mixed, with still no support for GROUP BY. The plan is that this will be added in EF Core 2.1.
Another wish-list item that's missing is support for complex types. These have been available and still are in 'full' Entity Framework, relying instead on owned or child types. Writing about this on the .NET blog, Diego B Vega said:
"You can now define “owned” or “child” entities which group properties within other entities, very similar to how complex types used to work in EF6, but with the ability to contain reference navigation properties."
The problem is that this uses a different syntax, making it harder to bring EF models into EF Core from other versions.
Another core SQL concept that hasn't been fully implemented is that of stored procedures. Stored procedures are executed at the server rather than transporting all the data to the app for processing, and can be much more efficient. There are work-arounds but it seems strange this hasn't been added.
Other items on the wish list that haven't been added yet are support for spatial types; and support for lazy loading, where objects are only loaded when they are needed. This is supported (and popular) in full Entity Framework, but has been delayed until EF Core 2.1.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Wednesday, 19 September 2018 )|