What is EF: EF is a Microsoft ORM, to perform CRUD operations in Databases. It was first introduced in year 2008.
Evolution of EF:
What is EF Core: EF core is not upgrade to EF 6.x, it is a complete new port to EF, in simple word a new product. It is built from scratch EF with a goal of ‘EF everywhere’, which means EF will run on all platforms (.NET Framework, .NET Core and Xamarin).
EF Core in comparison to EF 6.x
- Open Source: EF Core is open source project and is present on GitHub.
Link to GitHub: https://github.com/aspnet/EntityFramework
- EF Core everywhere
EF 6.x works only on .NET Framework whereas EF core is designed to run on .NET Framework, .NET Core and Xamarin also.


- EF Core allows to use Non-Relational Databases also.
Following are examples providers of EF core
- Relational Providers: Sql server, Postgres, Sqlcompact etc.
- Non- Relational Providers: Azure Storage Table, Redis. In future, more Non -Relational providers will be added.
- In-memory Testing: EF core is provided with InMemory provider which can be used in unit Testing by faking Db connection, without overhead of actual database operations.
- Light weight & extensible core: EF core light weight and extensible also. The new architect of EF core makes it extensible.

- Top level api is built over modular core
- Core Services are built as collection of services. IOC and DI is used while building these services.
- Optimized for memory and CPU usage
- Batching: During SaveChanges, EF 6 generates query for each update, insert or delete (except add range) while EF core uses batching.
Example: Following Code will generate 4 queries in EF 6 while one query in EF core. While EF core is smart enough to set batch size, user can also set it.
using (var context = new BlogContext())
{
context.Add<Blog>(new Blog { Id = 1, Name = “Blog1” });
context.Add<Blog>(new Blog { Id = 2, Name = “Blog4” });
context.Add<Blog>(new Blog { Id = 3, Name = “Blog4” });
context.Add<Blog>(new Blog { Id = 4, Name = “Blog4” });
context.SaveChanges();
}
- Client eval in LINQ queries
- Alternate keys.
- EF core simplified metadata api
- Same model, multiple platform: In EF Core, same model can be used for different platforms such as Sql Lite and Sql Server.
- Same Model, multiple databases: In EF core, same model can be used for different databases.
- Better caching: EF core has far better caching mechanism than EF 6.