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


GitHub Bounty Program Increases Rewards
20/02/2019

GitHub's Security Bug Bounty Program is now five years old and has been updated again with better rewards and a wider remit. Now a Microsoft-owned company, GitHub has also added Legal Safe Harbor [ ... ]



GitHub Launches Draft Pull Requests
18/02/2019

GitHub has added a way to show other developers that a pull request is code that is work in progress or even just an idea on how you're thinking of creating code.


More News

 

Python

 



 

Comments




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

Last Updated ( Wednesday, 19 September 2018 )