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.

ef

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 EF.Functions.Like() in a LINQ query and it will be translated to LIKE in SQL or evaluated in memory if necessary.

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 DbContext.

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.

 

ef

More Information

EF Core Page

EF Core Platforms Information

Related Articles

Entity Developer 6.0

EF7 Drops XML Modeling

Entity Framework Everywhere

Release Candidate of First Open Source Entity Framework Available

Entity Framework Open-Sourced - Good or Bad?

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Crazy Clocks
10/03/2024

It's that time again when the clocks change and  time is of the essence and I indulge my interest in crazy clocks. I am always surprised that there are still new ideas for how to display the time [ ... ]



Opaque Systems Introduces Gateway GenAI Solution
14/03/2024

Opaque Systems has announced an early access program for Opaque Gateway, software designed to address data privacy, security, and sovereignty concerns in managing GenAI implementations.


More News

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Wednesday, 19 September 2018 )