Entity Framework Core x Entity Framework 7

Asked

Viewed 1,101 times

15

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

It’s so much version and so much name change that I’m lost.

2 answers

15


EF7

Since EF 7 does not exist, it has zero differences. EF 7 is EF Core. By a rare flash Microsoft named the product properly (for a time 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 had no reason to use the same name, better start again.

EF6

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

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 technologies . NET Core may be the latest in the date of writing of this answer (4 years later and this is still true).

The EF Core is much lighter in all directions, is quite extensible and runs on several platforms. EF 6 has a large legacy load, including misguided things, and is centered on Windows. Another interesting point is that it embraces other data sources in an official way (memory, Nosql, data services, etc.), not just SQL databases from multiple vendors (all major ones on the market, from Sqlite to Oracle).

The general API for both is the same, at least in the main features. What continues to exist in Core should be almost all compatible. But much existing in EF 6 will not exist in Core, never (I am 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 have official support.

In general the recommendation is to use it in new applications and not to port 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 (this is no longer true) between these two. On the other hand it works with ASP.NET Core, Xamarin and UWP.

Differences

I am not going to make a list of resources that are not available in EF Core since it will be outdated quickly, but it has interesting news:

  • finally there is a good control for sending statements batch;
  • improvements in the use of raw SQL;
  • separation of what should be performed on the client and what should go to the server;
  • facilities to recover the database template (no longer exists database first);
  • shaded properties;
  • freedom to use alternative keys including generation in client.

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

I stress the idea that some features of EF 6 will never be supported in EF Core, but for good reason, they were "wrong". Others you’ll just have to wait a little.

Since the original version of this response much has changed, the EF6 now runs on. NET Core (on Windows) and a lot of new stuff has been put into EF Core, no longer consider as an updated response.

9

None

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

Due to a number of design decisions framework, the change follows aligned with the idea of not make ASP.NET Core compatible with ASP.NET MVC5 and 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.

  • What made me more confused is that there are packages Nuget so much for EF7 how much to Core, since they are one they should leave everything in one place.

  • 1

    Ah, yes, but these "7" packages will never leave the pre-release. They are only maintained for historical reasons.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.