EF Core 10 Is INSANE - Overview of Game Changer features
Introduction Most EF Core releases are a bag of small quality-of-life fixes. EF Core 10 has a few of those too, but it also lands several changes that remove long-standing workarounds: you no longer hand-write a GroupJoin plus SelectMany plus DefaultIfEmpty to get a left join, you no longer have one all-or-nothing global query filter, and you can now do vector similarity search against SQL Server…
EF Core 10 brings a handful of significant changes that enhance the framework's capabilities, making it more powerful and user-friendly. The most notable improvements include the introduction of LeftJoin and RightJoin as native query operators, replacing the cumbersome GroupJoin + SelectMany + DefaultIfEmpty pattern that was previously the go-to method for performing left joins in LINQ-to-Entities. This new feature simplifies the code, reduces verbosity, and improves readability.
Another major change is the ability to define and manage named query filters, which addresses a long-standing issue with global query filters. Previously, there was only one all-or-nothing global filter per entity, making it difficult to selectively enable or disable specific filters, such as soft delete or multi-tenancy, without disabling others.
With EF Core 10, you can now name these filters and toggle them individually, granting finer-grained control over query filtering behavior. This can be particularly useful in scenarios where you need to see soft-deleted rows while still respecting tenant isolation.
EF Core 10 also introduces the capability to map complex types to JSON within a single column. This allows you to store attribute bags, such as book attributes like genre, page count, language, and tags, in a single nvarchar column as JSON. This offers a middle ground between a rigid column-per-field schema and an untyped blob, providing flexibility for attribute bags that vary and are not worth their own table.
LINQ queries can still be used to filter and query into this JSON data, translating the predicates to SQL JSON path access.
One of the most exciting features is the integration of SQL Server's native vector type with EF Core 10 and the EF.Functions.VectorDistance function. This enables retrieval augmented generation (RAG) pipelines, allowing you to find the most semantically similar posts to a given text using a single EF Core query. This eliminates the need for a separate vector database and simplifies the implementation of RAG functionality using Microsoft.Extensions.AI for generating embeddings.
The update also includes improvements in the ExecuteUpdateAsync method, enabling more complex updates driven by other columns, which can help optimize bulk updates and avoid loading unnecessary entities. Additionally, various LINQ translation gaps have been closed, and better SQL is generated for existing queries, ensuring optimal performance for updates.
However, there are some important considerations to keep in mind. SQL Server must have the native vector type, which is available in SQL Server 2025 and recent Azure SQL versions. Older targets do not support this feature. Named filters are opt-in by name, so if you migrate existing single filters, you'll need to give them names and update every IgnoreQueryFilters() call site.
Also, filtering complex types stored as JSON works, but performance may vary depending on JSON indexing support in your database, so it's not always a free operation on large tables. Lastly, left join result selectors can yield nulls when there is no match, so it's essential to project defensively.
In summary, EF Core 10 is a game-changer with features that significantly improve the developer experience, from simplifying complex LINQ queries to providing powerful capabilities for querying and manipulating data. These enhancements make EF Core 10 an indispensable tool for developers working with .NET and SQL Server.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.