Internative Logo

What Is Entity Framework Core? The ORM for Modern .NET

What Is Entity Framework Core? The ORM for Modern .NET

Most business applications spend a large part of their code moving data between objects and database tables: loading a customer with their orders, saving a changed invoice, keeping the schema in step with the model as the product grows. Entity Framework Core takes over that work for .NET teams. You describe your domain in C# classes, query it with LINQ, and EF Core writes the SQL, tracks what changed and keeps the database schema in line through migrations.

This article explains what EF Core is, how it works, where it is the right default, where it gets in the way, and how it compares with Dapper and the other options.

What is Entity Framework Core?

Entity Framework Core (EF Core) is Microsoft's open-source object-relational mapper (ORM) for .NET. It maps C# classes to database tables, translates LINQ queries into SQL, tracks changes to loaded objects and saves them back in a transaction. Through database providers it works with SQL Server, Azure SQL, SQLite, PostgreSQL, MySQL, Oracle, Azure Cosmos DB and others.

The name carries some history. The original Entity Framework shipped in 2008 as part of .NET Framework 3.5 SP1 and grew into EF6, a Windows-era, .NET Framework-bound library. When Microsoft built the cross-platform .NET Core, it rewrote the ORM from scratch rather than port it. The rewrite was first called EF7, renamed Entity Framework Core during its release candidates, and EF Core 1.0 shipped on 27 June 2016, the same day as .NET Core 1.0.

Since then EF Core has followed the .NET release train, with a new major version every November. EF Core 10, which runs on .NET 10, is a long-term support release supported until November 2028. EF6 is still maintained for existing .NET Framework applications, but new development happens in EF Core.

How Entity Framework Core works

DbContext and DbSet. You define a class that inherits from DbContext, with a DbSet<T> property for each entity, such as DbSet<Order>. The context is your session with the database: it opens connections, runs queries and holds the objects it has loaded.

The model. EF Core builds a model of your entities, keys and relationships from conventions, which you can refine with attributes or the fluent API: column types, indexes, table names, one-to-many and many-to-many relationships, owned types and value conversions.

LINQ to SQL translation. A query such as context.Orders.Where(o => o.Total > 1000).Include(o => o.Customer) is translated by the database provider into SQL for that specific database. Only the data you ask for comes back, and related data is loaded eagerly with Include, explicitly, or lazily if you turn that on.

Change tracking and SaveChanges. Objects loaded through the context are tracked. When you change properties, add or remove entities and call SaveChanges, EF Core works out the INSERT, UPDATE and DELETE statements and runs them in one transaction. This is the unit of work pattern, built in.

Migrations. When the model changes, dotnet ef migrations add generates a migration class that describes the schema change, and dotnet ef database update or a generated SQL script applies it. For an existing database, dotnet ef dbcontext scaffold generates the classes from the schema instead.

Key features

  • LINQ queries with compile-time checking and IntelliSense, translated to the SQL of your database.
  • Change tracking and transactional SaveChanges.
  • Migrations for versioning the schema next to the code.
  • Many providers, including Microsoft SQL Server, PostgreSQL, SQLite, MySQL and Cosmos DB.
  • Bulk updates and deletes with ExecuteUpdate and ExecuteDelete, which run as a single SQL statement without loading entities.
  • JSON columns for storing parts of an entity as JSON in relational databases.
  • Raw SQL when needed, mapped to entities or to plain types.
  • Global query filters for soft delete and multi-tenant data, plus interceptors for auditing and logging.

Where Entity Framework Core is used

  • Enterprise line-of-business systems: ERP, CRM, HR and finance applications with many related entities.
  • ASP.NET Core web APIs and back offices built on .NET, where EF Core is the standard data layer.
  • SaaS products that need multi-tenant filtering, auditing and frequent schema changes.
  • Modernisation projects moving from EF6 and .NET Framework to modern .NET.
  • Domain-driven designs, where aggregates, value objects and owned types map naturally to EF Core's model.

When to choose Entity Framework Core, and when not to

Choose EF Core when:

  • The domain has many entities and relationships that are created, changed and saved together.
  • You want the schema versioned with the code through migrations.
  • Development speed and long-term maintainability matter more than the last few milliseconds on each query.
  • The team prefers typed LINQ over hand-written SQL for most of the work.

Look elsewhere, or add something, when:

  • A few queries are performance-critical or very complex, such as reporting with window functions. Write them in raw SQL through EF Core, or use Dapper for those paths.
  • The workload is large batch processing. Tracking thousands of objects is slow; use ExecuteUpdate, bulk copy tools or plain SQL.
  • The team does not look at the SQL that EF Core generates. N+1 queries, cartesian explosions from several Include calls and accidental client-side work are common mistakes. Logging the generated SQL and using AsNoTracking for read-only queries prevent most of them.
  • The data is document-shaped and lives in a document database. EF Core has a provider for MongoDB, but the native MongoDB driver is often the more direct fit.

Entity Framework Core and its alternatives

OptionTypeBest fit
Entity Framework CoreFull ORM with LINQ, tracking, migrationsDomain-rich .NET applications
DapperMicro-ORM, you write SQLHot read paths, reporting, existing schemas
EF6Older full ORM for .NET FrameworkExisting .NET Framework applications only
NHibernateFull ORM, port of Java's HibernateLong-running projects already built on it
linq2dbLightweight LINQ ORM without trackingTyped SQL with minimal overhead

The comparison most teams make is EF Core vs Dapper, and in practice they are used together: EF Core for the domain model, writes and migrations, Dapper for the handful of queries that need hand-tuned SQL. The Dapper article covers that decision from the other side. Outside .NET, Prisma plays a similar role for TypeScript teams.

How we use Entity Framework Core at Internative

We use EF Core for backend systems that need fast development, strong domain modelling and long-term maintainability. It lets us balance productivity with performance in scalable .NET applications: the domain lives in readable C# classes, schema changes travel with the code, and the queries that need more control can still be written by hand.

If you are building a new business system on .NET, or moving an EF6 application to modern .NET, our enterprise software and product modernization teams can help you plan the data layer.

Frequently asked questions

Is EF Core an ORM?

Yes. EF Core is an object-relational mapper: it maps C# classes to database tables, turns LINQ queries into SQL and saves changes to objects back to the database.

What is the difference between Entity Framework and Entity Framework Core?

Entity Framework (EF6 and earlier) was built for the Windows-only .NET Framework. EF Core is a rewrite for cross-platform .NET, with better performance, more database providers and active development. EF6 is maintained for existing applications; new projects should use EF Core.

Which databases does EF Core support?

Microsoft maintains providers for SQL Server, Azure SQL, SQLite, Azure Cosmos DB and an in-memory provider for testing. Community and vendor providers cover PostgreSQL, MySQL, MariaDB, Oracle, MongoDB and others.

Do I need Microsoft.EntityFrameworkCore.Design?

Only for design-time work. The package contains the logic that the dotnet ef tools use to create migrations and scaffold a model from an existing database. Your application does not need it at runtime.

What can I use instead of Entity Framework?

Dapper is the most common alternative when you want to write SQL yourself with fast mapping. Plain ADO.NET gives full control, and lighter LINQ libraries such as linq2db sit in between. Many teams keep EF Core and add Dapper only where it pays off.

Related services

Where this topic becomes an engagement.

Keep reading

The articles that follow this one.