Entity Framework Core x Entity Framework 7

8

What are the main differences between Entity Framework Core and Entity Framework 7? There are scenarios in which one is more indicated than the other.

It's such a version and so much change of name that I'm lost.

    
asked by anonymous 14.09.2016 / 05:22

2 answers

11

EF7

Since EF 7 does not exist, it has zero differences. EF 7 is EF Core. By a rare flashpoint Microsoft named the product properly (for a while the unofficial name was EF 7). As the new version is a new product written from scratch and does not guarantee compatibility with the previous version, you did not have to use the same name, better start over.

EF6

If the comparison is with EF 6, the last created for standard .NET, then it is best to look at official comparison documentation and the document to decide EF Core is right for you . In summary:

EF 6 is a mature and complete product that will continue to be supported. But it will not have great evolutions. The future is Core. But of all .NET Core technologies perhaps that is the latest on the date of writing this answer.

EF Core is much lighter in every way, it's extensible and runs on many platforms. EF 6 has a large legacy load, including the wrong things, in addition to being Windows-centric. Another interesting point is that it embraces other sources of data in an official way (memory, NoSQL, data services, etc.), not only SQL databases from various vendors (all the leading vendors from SQLite to Oracle) / p>

The general API for using both is the same, at least in key features. What still exists in Core should be almost all compatible. But a lot of things in EF 6 will not exist in Core, ever (I'm not talking about what has not yet been developed due to lack of time). Some features may be recreated by third parties but will not be officially supported.

In general, the recommendation is to use it in new applications and not carry what already exists, unless you need a restructuring of what exists. But if you are going to use .NET Core, EF Core is the only option, between those two EF 6 will never work on it (at least that's the idea, and I doubt it will change one day). On the other hand it works with ASP.NET Core, Xamarin and UWP.

Differences

I will not make a list of features that are not available in EF Core as it will be out of speed quickly. But it has some interesting news:

  • Finally there is a good control for sending batch statements
  • Improvements to using raw SQL;
  • separation of what should be done on the client and what should go to the server;
  • facilities to recover the database model (there is no database first );
  • Shaded Properties ;
  • freedom to use alternate keys including client-side generation.

The recommendation would be to ask about specific items that are needed in some scenario, or consult the documentation.

I underscore the idea that some EF 6 features will never be supported on EF Core, but for good reason, they were "wrong." Others will just have to wait a little.

    
14.09.2016 / 08:01
6

None

The Entity Framework 7 was renamed Entity Framework Core . The goal is not to make an impression that Entity Framework 6 can be upgraded to Core (as might suggest the 7th as the natural sequence of version 6).

Due to a series of framework design decisions, the change follows the idea of not to make ASP.NET Core be compatible with ASP.NET MVC5 and with the ASP.NET Web API , which could bring many future problems.

Note that ASP.NET Identity also follows the same principle, precisely because of its coupling with the Entity Framework Core.

    
14.09.2016 / 06:20