What's the difference between EF Core and EF6?
And which one should I use?
TL;DR
Use EF Core.
Or EF6 if it works better for you.
Or Dapper.
EF Core
- Designed for .NET Core. Integrates well with other parts of .NET Core, such as ASP.NET Core.
- Latest release (3.1) runs on .NET Core and .NET Framework, through .NET Standard 2.0.
- Next release (5.0) will not run on .NET Framework.
- Active Microsoft and community development at github.com/dotnet/efcore.
- Generally more features than EF6, but also missing some.
EF6
- Designed for .NET Framework. Integrates well with .NET Framework concepts such as App.Config.
- Latest release (6.4) runs on .NET Core and .NET Framework, through multi-targeting.
- Future releases will continue support for .NET Core and .NET Framework.
- Future development will emphasize stability, getting only critical bug fixes.
FAQ
Q: I'm starting a new .NET Core application. What should I use?
A: Use EF Core.
Q: I'm porting an existing application that uses EF6 to run on .NET Core. What should I use?
A: If the application (or specifically the data access code using EF6) is relatively stable, then keep using EF6. If the application will continue to be evolved after the move, then port to EF Core.
Q: What if I'm starting a new application on .NET Framework?
A: First, seriously consider using .NET Core instead. If you are going to use .NET Framework, then EF6 is the right choice.
Q: What about UWP/Xamarin/WinForms/WPF/WinUI/Blazor/Unity/MyPlatformOrStackOfChoice?
A: Use EF Core. We have EF Core 5.0 work planned to improve the experiences with many of these technologies. EF6 may work on platforms other than .NET Core and .NET Framework, but this isn't a goal for EF6.
Q: I can't use EF Core without (insert feature here). Why isn't it done yet?
A: Because EF is used by a lot of developers, and those developers want a lot of different features! The release planning process describes how we decide what to work on. We also welcome feedback on the plan for EF Core 5.0.
Q: What if I want to use (substitute your technology of choice) instead of EF?
A: Go for it! Anything that makes your .NET experience better is something we support. (Dapper is a fine choice. You might also consider using EF Core for some things, with Dapper where you need more control.)
This page is up-to-date as of January 29th, 2020.
Some things change.
Some things stay the same.
Use your noggin.