← Back to blog

Oct 20, 2026 · 9 min read

Entity Framework Core in 2025: What's New and What's Worth Using

EF Core has evolved from the slow-but-convenient ORM reputation to a serious data access layer with compiled models, JSON column support, and AOT compatibility. Here's what's changed and what's worth adopting.

.NETEntity FrameworkDatabase

Entity Framework Core has spent the last few releases shedding its reputation as "the slow ORM that's convenient but not fast." With compiled models, JSON column support, Native AOT compatibility, and steady performance improvements, it's now a serious data access layer that happens to also be convenient.

Compiled models: startup time that doesn't suck

EF Core's startup cost has been a long-standing complaint. The first query in an application triggers model building, mapping, and provider initialization, which can take seconds in large models.

Compiled models, introduced in EF Core 7 and refined through .NET 9 and 10, pre-build the model at compile time:

// Program.cs
optionsBuilder.UseSqlServer(connectionString)
    .UseCompiledModel(typeof(MyCompiledModel).Assembly);

For large models (100+ entities), this cuts startup time from seconds to milliseconds. The trade-off is that model changes require recompilation, but for production deployments, that's the point.

Compiled models are most valuable for large models and cold-start scenarios like serverless functions and containerized workloads where startup time matters.

JSON column support

EF Core 8 added JSON column mapping for SQL Server, and EF Core 9 extended it to PostgreSQL and SQLite. You can now map complex types to JSON columns:

public class Order
{
    public int Id { get; set; }
    public CustomerInfo Customer { get; set; }  // Mapped to JSON column
}

public class CustomerInfo
{
    public string Name { get; set; }
    public Address ShippingAddress { get; set; }
    public List<string> Tags { get; set; }
}

// DbContext
modelBuilder.Entity<Order>()
    .OwnsOne(o => o.Customer, builder =>
    {
        builder.ToJson();
        builder.OwnsOne(c => c.ShippingAddress);
    });

You can query into JSON columns with LINQ:

var orders = await db.Orders
    .Where(o => o.Customer.Tags.Contains("vip"))
    .ToListAsync();

This is useful for semi-structured data that doesn't warrant its own table but needs to be queryable. It's also a clean way to handle evolving schemas without migrations.

Native AOT support

EF Core 9 added partial Native AOT support, and EF Core 10 extends it. This matters for:

  • Serverless functions where cold start time directly affects cost
  • CLI tools that should start instantly
  • Microservices deployed as single-file native executables

The limitation: not all providers support AOT yet. SQL Server and PostgreSQL work. Some third-party providers don't. Check before committing.

Performance: where EF Core stands now

AreaImprovement
Query executionFaster materialization, reduced allocations
Change trackingMore efficient change detection
Connection poolingBetter connection reuse
Compiled queriesCached execution plans
Bulk operationsExecuteUpdate / ExecuteDelete for set-based updates

The ExecuteUpdate and ExecuteDelete methods are particularly useful. They execute UPDATE or DELETE statements directly against the database without loading entities into memory:

// Before: load all, update, save (slow)
var users = await db.Users.Where(u => u.LastLogin < cutoff).ToListAsync();
foreach (var user in users) user.IsActive = false;
await db.SaveChangesAsync();

// After: single SQL statement (fast)
await db.Users
    .Where(u => u.LastLogin < cutoff)
    .ExecuteUpdateAsync(s => s.SetProperty(u => u.IsActive, false));

For bulk operations, the difference is orders of magnitude.

Best practices in 2025

Use AsNoTracking for read-only queries. EF Core's default change tracking adds overhead. For queries that don't need to update entities, disable it:

var users = await db.Users.AsNoTracking().ToListAsync();

Use IAsyncEnumerable for large result sets. Streaming results instead of materializing them all at once reduces memory pressure:

await foreach (var user in db.Users.AsAsyncEnumerable())
{
    Process(user);
}

Prefer ExecuteUpdate / ExecuteDelete for bulk operations. Don't load entities just to change a field.

Use compiled queries for hot paths. If a query runs thousands of times, compile it:

static readonly Func<MyDb, int, Task<User>> GetUserById =
    EF.CompileAsyncQuery((MyDb db, int id) =>
        db.Users.FirstOrDefault(u => u.Id == id));

Don't use lazy loading in web apps. It causes N+1 queries and is hard to debug. Use eager loading (Include) or explicit loading.

When not to use EF Core

EF Core is not the right tool for everything:

  • Reporting queries with complex joins and aggregations are often better written in raw SQL (using Dapper or ADO.NET directly).
  • High-throughput write paths where every millisecond matters may benefit from a lighter ORM or direct SQL.
  • Multi-tenant databases with complex tenant isolation can be easier to manage with a thinner data layer.

The honest guideline: use EF Core for most data access, and reach for Dapper or raw SQL when you have a specific query that EF Core handles poorly. This is not a compromise — it's using the right tool for each job.

The bottom line

EF Core in 2025 is not the EF Core of 2019. The performance gap with micro-ORMs has narrowed, the feature set has expanded, and the AOT story is real. If you dismissed EF Core a few years ago because it was slow, it's worth a fresh look.

For most .NET applications, EF Core is the right default. Use it for the 90% of data access that's straightforward, and reach for lower-level tools when you hit a specific performance need. That's not a compromise — it's pragmatism.

Need help applying this?

Schedule call →