main banner

Consulting Insights

EF Core 2.2 Preview presentation

Watching the .NET Conf 2018, it was time to present Entity Framework Core 2.2 Preview version. This event got my attention because I'm on the way to implement a POC using .NET Core so my interest on EF Core features and its limitations was sparked.

EF Core 2.2 is a preview version and they left it clear it's about fixes, improvements and Cosmos DB Provider among other features they developed to leverage the provider development. The team is focused on working hard to release EF Core 3.0 shortly, so for this release the Crown Jewels are the support to the Cosmos DB Provider for NRDB as well as Spatial Data processing. Improvements in Owned Entity Types were briefly mentioned. Those enhancements now allow to create 1toM relationships and also represent the cornerstone on which the NRDB development was created.

Close to Owned Entity Types, another feature that was announced was Query tag. It is a sort of debugging tool that helps to identify, by using tag comments, which SQL query was created from which piece of a complex LINQ query.

EF Core team were so happy to announce the Cosmos SQL Provider given by API that provides methods to handle DDL sentences and CRUD operations can be executed from LINQ queries. The team proudly explained how advances in unity and binary operations improved the algorithms in charge of filtering the Where predicates preventing from unnecessary fetching to server increasing the performance. Besides that, more LINQ operations have been mapped to be carried out as server side functions.

Cosmos SQL Provider still has some limitations such as LINQ running synchronously, include clause that could increase server round trips, Join not fully supported yet, and client running complex queries due in-memory evaluations when different entities are joint.

Regarding Spatial Data... NetTopologySuite, a robust library widely tested in the PostgresSQL field, was introduced to include Polygons, Point, and more types in LINQ queries granting support to server side Spatial computations, such as distance.

It’s not just about Cosmos DB. There are some good news over the horizon. There is a promise of an EF Core 3 with backward compatibility, performance improvements for LINQ, support to aggregates and AsynchEnumerables<T>, boosting search and iterations handling. Another interesting concept they are working with is the the property bag entities which will ease the implementation of MtoM relationships (with an entity in the middle) and its navigation properties as well as erasing Type Providers, types generated in design time but not preserved at runtime, this is for F#.

My only concern regarding this presentation is the aftertaste that they are working with NRDB having a relational database mindset. They talked about mapping between tables, cascade delete, etc. Something pretty similar occured eons ago when imperative elements were introduced to SQL... People can easily abuse of this commodity. Besides that, direct MtoM relationships is out of the road map, the same for bulk inserts and machine learning. Viewing the bright side, the product is maturing and Development Team is committed with end user’s feedback... so if we, as community, miss a particular feature from EF 6, letting them know is a first step in the right direction.

More details:

EF core 2.2... what's cooking?

With Diego Vega, Program Manager and Smit Patel, Software Engineer

Announcing Entity Framework Core 2.2 Preview 2 and the preview of the Cosmos DB provider and spatial extensions for EF Core -

Luis G.

An expert we all come to when in doubt, Luis was born in Monterrey and has a B.S. Electronic Systems Engineering degree His multiple abilities are backed 10 years of experience in .NET, SQL and recently joined the ranks of front end developers. A Star Wars and Lego enthusiast, he is also a loving father and a very friendly co-worker who writes for the Inflection Point’s blog with lots of inspiration and fills our blog with descriptions of our work environment that recall us all of the good times.