loading experience

Entity Framework Core

EF Core 10: LeftJoin, named filters and vector search

The most useful new features of Entity Framework Core 10 for everyday work.

EF Core 10: LeftJoin, named filters and vector search

Entity Framework Core 10 ships alongside .NET 10 as a long-term support release. Here are the new features that simplify everyday code the most.

Each filter has a name and can be disabled alone, leaving the others active.
Each filter has a name and can be disabled alone, leaving the others active.

LeftJoin and RightJoin

A left join in LINQ used to require an unreadable combination of GroupJoin, SelectMany and DefaultIfEmpty. Now there is a dedicated operator:

var rows = await db.Customers
    .LeftJoin(db.Orders,
        c => c.Id,
        o => o.CustomerId,
        (c, o) => new { c.Name, Total = o == null ? 0 : o.Total })
    .ToListAsync();

Named query filters

Global filters (for example "only non-deleted rows" or "only the current tenant") can now be more than one per entity and have a name, so you can disable just one of them:

modelBuilder.Entity<Document>()
    .HasQueryFilter("NotDeleted", d => !d.IsDeleted)
    .HasQueryFilter("Tenant", d => d.TenantId == _tenantId);

// recycle bin: include deleted rows, but still only for the current tenant
var bin = await db.Documents
    .IgnoreQueryFilters(["NotDeleted"])
    .Where(d => d.IsDeleted)
    .ToListAsync();

Vector search

With SQL Server 2025 and Azure SQL, EF Core 10 supports the vector type and the distance function: you can store embeddings generated by an AI model and find the most similar documents directly with LINQ, without a separate database. It is the foundation for semantic search and for systems that enrich a language model's answers with company documents.

Other improvements

  • Support for the native JSON type of recent SQL Server versions.
  • More flexible complex types, including optional ones and ones mapped to JSON columns.
  • ExecuteUpdateAsync is easier to compose with conditional logic.
Comments (0)

No comments yet.

Leave a comment