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, FacebookGoogle+ or Linkedin.

 

Banner


FSF Update Rules Commons Clause Non-Free
12/11/2018

The Free Software Foundation has added the Commons Clause to its list of non-free licenses among a number of recent updates to its licensing materials. Other changes clarify the GNU GPL position on tr [ ... ]



Google's AI Impact Challenge - $25 Million For Social Good
30/10/2018

At the Google AI For Social Good event, Google.org, issued a call to organizations around the world to submit their ideas for how they could use AI to help address societal challenges. Selected organi [ ... ]


More News

 

Python

 



 

Comments




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

Last Updated ( Wednesday, 19 September 2018 )