LEARN BUILD GROW TOGETHER
DEVELOPER LEARNING HUB
Learn. Build. Grow Together.

Practical tutorials, real-world examples and interview preparation.

.NETC#SQL SERVERANGULAR
Home /.NET 11 /What's New in LINQ & EF Core 11 With Examples

What's New in LINQ & EF Core 11 With Examples

Skills Tutorials · .NET 11

What's New in LINQ & Entity Framework Core 11?

Explore the latest LINQ join APIs and EF Core 11 query improvements with practical C# examples, result sets, and SQL translation. Learn what changed, why it matters, and where to use it.

.NET 11LINQEF Core 11C# ExamplesSQL Translation

LINQ and Entity Framework Core continue to evolve to make data queries easier to write and more efficient to execute. In .NET 11, LINQ introduces join improvements such as FullJoin() and tuple-returning overloads for Join() and GroupJoin(). EF Core 11 builds on these changes with SQL translation improvements, including support for translating FullJoin() to SQL and optimizations that can remove unnecessary joins, ordering, or casts.

This guide focuses only on the new LINQ and EF Core 11 changes—not a general LINQ or EF Core introduction.

Version note: LeftJoin() and RightJoin() were introduced in .NET 10. They are included only for comparison. The new LINQ features covered here are the .NET 11 FullJoin(), tuple-returning join overloads, and related comparer support.

1. LINQ FullJoin() — Full Outer Join in LINQ

A full outer join returns all records from both sequences. Where keys match, the records are paired. If a record on either side has no match, it still appears in the result with the other side set to its default value (typically null for reference types).

Example scenario

Imagine we have customers and orders. Some customers have orders, some have none, and an order may have a missing or unmatched customer record. We want to see every customer and every order in a single result.

Sample data

C# · Sample collections
var customers = new[]
{
    new Customer(1, "Aarav"),
    new Customer(2, "Mira"),
    new Customer(3, "Kabir")
};

var orders = new[]
{
    new Order(101, 1, "Laptop"),
    new Order(102, 1, "Mouse"),
    new Order(103, 4, "Keyboard") // CustomerId 4 doesn't exist
};

Before .NET 11: workaround using LeftJoin + Union

Before the built-in full join, developers commonly composed a left join with a second query to find unmatched right-side records, then combined the results. This was more verbose and required careful handling of null/default values and duplicate semantics.

C# · Illustrative workaround
// Left-side records, including unmatched customers
var leftSide = customers
    .LeftJoin(orders,
        c => c.Id,
        o => o.CustomerId,
        (c, o) => new { Customer = c, Order = o });

// Right-side records whose customer key has no match
var unmatchedOrders = orders
    .Where(o => !customers.Any(c => c.Id == o.CustomerId))
    .Select(o => new { Customer = (Customer?)null, Order = o });

var fullOuterJoin = leftSide.Concat(unmatchedOrders);

This demonstrates the general pattern, not a universal replacement: depending on the source type/provider, nullability, equality rules, and duplicate behavior, the workaround may need adjustment.

In .NET 11: use FullJoin()

C# · FullJoin
var result = customers.FullJoin(
    orders,
    customer => customer.Id,
    order => order.CustomerId);

foreach (var (customer, order) in result)
{
    Console.WriteLine(
        $"Customer: {customer?.Name ?? "(no customer)"}, " +
        $"Order: {order?.Product ?? "(no order)"}");
}

Expected output (illustrative)

Customer: Aarav, Order: Laptop Customer: Aarav, Order: Mouse Customer: Mira, Order: (no order) Customer: Kabir, Order: (no order) Customer: (no customer), Order: Keyboard

Because the new overload returns a tuple, we can deconstruct it directly in the foreach loop. A full join preserves unmatched customers Mira and Kabir and the unmatched Keyboard order. Row order is not guaranteed unless you add an explicit ordering to the query; this output is illustrative.

When to use it: reconciliation reports, comparing two datasets, inventory mismatches, matching users against transactions, and identifying records that exist on only one side.

2. Tuple-returning Join()

LINQ's existing Join() required a result selector to shape each matching pair. .NET 11 adds an overload that returns the matched pair as a tuple, so you can use the pair directly or deconstruct it.

Before .NET 11

C# · Result selector required
var joined = products.Join(
    orders,
    product => product.Id,
    order => order.ProductId,
    (product, order) => new { product, order });

foreach (var item in joined)
{
    Console.WriteLine($"{item.product.Name}: qty={item.order.Quantity}");
}

In .NET 11

C# · Tuple result
var joined = products.Join(
    orders,
    product => product.Id,
    order => order.ProductId);

foreach (var (product, order) in joined)
{
    Console.WriteLine($"{product.Name}: qty={order.Quantity}");
}

Example output

Laptop: qty=3 Laptop: qty=1

Instead of creating an anonymous object in the result selector, the overload returns the matching elements together in a tuple. Tuple names in the returned result are inferred from the source parameters, and deconstruction makes the pair convenient to consume.

3. Tuple-returning GroupJoin()

GroupJoin() produces a result for each element in the outer sequence along with a sequence of matching elements from the inner sequence. The .NET 11 overload returns that pair as a tuple, removing the need to write a result selector when you want to keep both pieces.

Before .NET 11

C# · GroupJoin result selector
var grouped = departments.GroupJoin(
    employees,
    department => department.Id,
    employee => employee.DepartmentId,
    (department, matchingEmployees) =>
        new { department, matchingEmployees });

In .NET 11

C# · Tuple result
var grouped = departments.GroupJoin(
    employees,
    department => department.Id,
    employee => employee.DepartmentId);

foreach (var (department, matchingEmployees) in grouped)
{
    Console.WriteLine($"Department: {department.Name}");

    foreach (var employee in matchingEmployees)
        Console.WriteLine($"  - {employee.Name}");
}

Example output

Department: Engineering - Neha - Rohan Department: HR - Aisha Department: Finance

Each department appears, even if its matching employee sequence is empty. This makes GroupJoin() useful for grouped reporting and parent-child relationships.

4. Custom equality comparer support

Join operations usually compare keys using their default equality behavior. .NET 11 adds comparer overloads to the new outer join operators and tuple-returning Join()/GroupJoin() overloads. You can provide an IEqualityComparer<TKey> when the default equality rule is not what your query needs.

Case-insensitive matching example

Suppose product category keys contain inconsistent casing, such as "hardware" and "Hardware". A case-insensitive comparer can treat those keys as equal.

C# · Comparer for string keys
var products = new[]
{
    new Product(1, "Laptop", "Hardware"),
    new Product(2, "Desk", "Furniture")
};

var categories = new[]
{
    new Category("hardware", "Devices and components"),
    new Category("FURNITURE", "Office furniture")
};

var matches = products.Join(
    categories,
    product => product.Category,
    category => category.Name,
    StringComparer.OrdinalIgnoreCase);

foreach (var (product, category) in matches)
    Console.WriteLine($"{product.Name} => {category.Description}");

Output

Laptop => Devices and components Desk => Office furniture

In .NET 11, EqualityComparer<T>.Create() also provides a factory for creating an equality comparer from a key selector. For example, you can create a comparer that compares people by normalized email or records by a chosen property instead of comparing the entire object.

C# · EqualityComparer factory (conceptual key selector)
// Build an equality comparer based on a selected key property.
var emailComparer = EqualityComparer<User>.Create(
    user => user.Email,
    StringComparer.OrdinalIgnoreCase);

var uniqueUsers = new HashSet<User>(emailComparer)
{
    new User("alex@example.com"),
    new User("ALEX@example.com"), // Duplicate by email
    new User("sam@example.com")
};

Console.WriteLine(uniqueUsers.Count); // 2
Comparer and provider note: Comparer-based query overloads are part of the .NET 11 LINQ APIs, but a database provider may not translate every custom comparer to SQL. Test the actual EF Core provider and query. A comparer that works for in-memory LINQ is not automatically translatable to server-side SQL.

5. Enumerable vs Queryable vs AsyncEnumerable

The new join APIs are available across Enumerable, Queryable, and AsyncEnumerable. Their execution model is still different—choosing the correct one matters.

APIWorks withTypical executionCommon use
EnumerableIEnumerable<T>Runs LINQ operations over in-memory objects; deferred until enumeration for most query operators.Lists, arrays, in-memory collections.
QueryableIQueryable<T>Builds an expression tree. A provider (such as EF Core) interprets it—often translating it into SQL.Database queries.
AsyncEnumerableIAsyncEnumerable<T>Enumerates asynchronously with await foreach; useful for asynchronous streams.Async streams, streaming data, supported async LINQ pipelines.

Enumerable example

C# · In-memory query
var joined = customerList.FullJoin(
    orderList,
    customer => customer.Id,
    order => order.CustomerId);

foreach (var pair in joined)
{
    // Query executes over in-memory data as it is enumerated.
}

Queryable example with EF Core

C# · Database-backed query
var query = db.Customers.FullJoin(
    db.Orders,
    customer => customer.Id,
    order => order.CustomerId);

var rows = await query.ToListAsync();

Here, the EF Core provider processes the query expression and translates supported parts to SQL. Calling ToListAsync() executes the database query and materializes its results.

AsyncEnumerable example

C# · Async sequence
// When using the async LINQ APIs on IAsyncEnumerable sequences:
await foreach (var (left, right) in asyncSequence)
{
    // Consume each result asynchronously.
}
The operators are exposed on these LINQ surfaces, but the exact execution and translation depend on the sequence type and its provider. IQueryable does not mean SQL by itself—it needs a query provider.

6. EF Core 11: FullJoin translated to SQL FULL JOIN

EF Core 11 translates the new LINQ FullJoin() operator to SQL FULL JOIN for supported relational providers. For the EF Core example, use the documented result-selector overload to shape the pair explicitly.

C# · EF Core query (result selector)
var results = await context.Customers
    .FullJoin(
        context.Orders,
        customer => customer.Id,
        order => order.CustomerId,
        (customer, order) => new { Customer = customer, Order = order })
    .ToListAsync();

SQL generated (simplified)

SQL · FULL JOIN
SELECT c.Id, c.Name, o.Id, o.CustomerId, o.OrderDate
FROM Customers AS c
FULL JOIN Orders AS o
    ON c.Id = o.CustomerId;

The database returns matching pairs, customers without orders, and orders without matching customers. The tuple-returning LINQ overload is convenient in general LINQ use, but do not assume every overload or custom comparer shape is translated by every EF Core provider. SQL shown is simplified for readability; exact SQL varies by provider and query shape.

Why this matters: This is a server-side query translation. Avoid forcing premature materialization with ToList() before the join if you want EF Core to perform the operation in SQL.

7. Better SQL for to-one joins

EF Core 11 can prune unnecessary joins when querying reference (to-one) navigations. In split-query scenarios, EF previously could include joins to reference navigation tables even when they weren't required for the split collection query. EF Core 11 removes such redundant joins in supported query shapes.

Example query

C# · Include with split query
var blogs = await context.Blogs
    .Include(blog => blog.BlogType)
    .Include(blog => blog.Posts)
    .AsSplitQuery()
    .ToListAsync();

In earlier SQL, the split query for posts could contain an unnecessary join to the blog type table. In EF Core 11, that join is pruned from the query when it isn't needed, reducing the work the database must do.

The exact SQL and performance impact depend on the model, provider, indexes, query shape, and database. Check the generated SQL and benchmark your workload.

8. GroupBy translation enhancements

EF Core 11 improves translation and materialization for supported GroupBy() shapes. Examples include navigation access and joins over a per-group top result, aggregate expressions over reference navigations translated using joins before grouping, and left-joined non-entity projections correctly materialized through joins and grouping. This is a translation improvement—not a promise that all arbitrary grouped LINQ expressions will execute on the server.

Example: highest-rated post per blog

C# · Grouping and per-group selection (shape varies by provider)
var query = context.Posts
    .GroupBy(post => post.BlogId)
    .Select(group => group
        .OrderByDescending(post => post.Rating)
        .First());

var topPosts = await query.ToListAsync();

EF Core's newer translation capabilities can handle more compositions of grouping, joins, and navigation access. Not every arbitrary LINQ grouping expression is guaranteed to translate—translation depends on the supported pattern and provider.

9. Removing redundant CAST expressions

EF Core sometimes produced a SQL cast where a column was converted to the type it already had. Such no-op casts add noise and, in some cases, can interfere with index usage. EF Core 11's SQL post-processing removes recognized no-op casts.

Before

SQL · Redundant cast
SELECT u.Id, u.Name
FROM Users AS u
WHERE CAST(u.Name AS nvarchar(max)) LIKE N'Name%';

EF Core 11

SQL · Simplified expression
SELECT u.Id, u.Name
FROM Users AS u
WHERE u.Name LIKE N'Name%';

With the unnecessary conversion removed, the predicate can be more index-friendly when an appropriate index exists and the rest of the query/database conditions allow it.

10. MinBy() and MaxBy() translation

Min() and Max() return a scalar value. MinBy() and MaxBy() return the element associated with the minimum or maximum value selected by a key. EF Core 11 adds SQL translation for these LINQ operators, including their asynchronous counterparts.

Example: Find the blog with the most posts

C# · MaxBy
var blogWithMostPosts = await context.Blogs
    .MaxByAsync(blog => blog.Posts.Count());

This asks for the entity with the greatest post count, rather than returning just the count. EF Core translates supported query forms to SQL. Tie behavior and generated SQL may depend on the provider and query shape; add a secondary ordering when deterministic tie-breaking is required.

MinBy example

C# · MinBy
var oldestBlog = await context.Blogs
    .MinByAsync(blog => blog.CreatedOn);

Use these when you need the row/entity corresponding to a key extremum. If you only need the minimum or maximum scalar value, Min() or Max() may express that more directly.

11. Complex types with TPT and TPC inheritance

EF Core 11 expands support for complex types when used with the TPT (Table-per-Type) and TPC (Table-per-Concrete-Type) inheritance mapping strategies, including scenarios involving JSON-mapped complex data. This can make it possible to model reusable value-like structures alongside these inheritance patterns.

Illustrative model

C# · Complex type
[ComplexType]
public class Address
{
    public string City { get; set; } = "";
    public string Country { get; set; } = "";
}


public abstract class Person
{
    public int Id { get; set; }
    public Address Address { get; set; } = new();
}

public class Employee : Person
{
    public string JobTitle { get; set; } = "";
}

public class Contractor : Person
{
    public string ContractCompany { get; set; } = "";
}

Configure TPT inheritance

C# · Model configuration
modelBuilder.Entity<Person>()
    .ToTable("People");

modelBuilder.Entity<Employee>()
    .ToTable("Employees");

modelBuilder.Entity<Contractor>()
    .ToTable("Contractors");

EF Core 11 expands complex-type and JSON-column support for entities using TPT and TPC inheritance. Configure the inheritance strategy and complex property mapping explicitly, then validate generated migrations and queries against the provider you use.

12. Ordered string aggregation in SQLite

For SQLite, EF Core 11 adds support for ordered values in string aggregation translations using string.Join() or string.Concat() over grouped data. This lets the order of concatenated values be expressed within the aggregate query in supported cases.

Example

C# · Aggregate ordered post titles
var blogs = await context.Blogs
    .Select(blog => new
    {
        blog.Name,
        Titles = string.Join(
            ", ",
            blog.Posts
                .OrderByDescending(post => post.Id)
                .Select(post => post.Title))
    })
    .ToListAsync();

On SQLite, this can translate to an ordered group_concat expression. Translation is provider-specific; this exact translation is a SQLite feature. Ordered aggregation requires SQLite 3.44.0 or later.

13. Other EF Core 11 changes worth knowing

  • Date/time translations: Additional SQL Server translations for DateTimeOffset properties and offset components, and support for EF.Functions.DateTrunc() across relevant date/time types.
  • JSON and complex type mapping: Expanded support in inheritance scenarios, including TPT/TPC complex types.
  • Migration tooling: New workflow/tooling options for applying migrations and managing EF CLI configuration.
  • SQL Server JSON path: EF.Functions.JsonPathExists() translates to JSON_PATH_EXISTS on SQL Server 2022+.
  • SQL Server JSON collections: For SQL Server 2025 compatibility level 170, eligible primitive JSON collection Contains() queries can translate to JSON_CONTAINS; provider and nullability conditions apply.
  • SQL Server vector and hybrid search: EF Core 11 supports vector indexes/search and examples combining vector search with full-text ranking; SQL Server vector APIs are experimental/provider-specific.
  • SQL Server compatibility default: EF Core 11's SQL Server provider defaults to compatibility level 160 (SQL Server 2022). Older SQL Server deployments may need an explicit compatibility-level setting.

Example: JSON path exists (SQL Server 2022+)

C# · JSON path filter
var blogs = await context.Blogs
    .Where(blog => EF.Functions.JsonPathExists(
        blog.JsonData, "$.OptionalInt"))
    .ToListAsync();

This checks whether the specified JSON path exists in the document. SQL Server translation requires a version supporting JSON_PATH_EXISTS (SQL Server 2022 or later).

Vector properties are not selected by default

EF Core 11 avoids loading vector columns when materializing entities, reducing unnecessary data transfer for large embeddings. If you need the vector values, explicitly project them:

C# · Explicit vector projection
var embeddings = await context.Blogs
    .Select(blog => new { blog.Id, blog.Embedding })
    .ToListAsync();

Vector properties can still participate in supported filters and ordering, including vector-distance and vector-search scenarios.

Upgrade reminder: Review EF Core 11 breaking changes and provider-specific notes before upgrading an existing production application—especially the SQL Server compatibility-level change.

14. Which changes matter most in real projects?

FeatureDeveloper benefitWhere it helps
FullJoin()Less custom join plumbing; easier reconciliation queriesReports, data audits, comparing datasets
Tuple-returning joinsLess result-selector boilerplateReadable LINQ pipelines
Comparer overloadsCustom key equality in supported LINQ joinsCase-insensitive or normalized-key matching
SQL join pruningReduced unnecessary query workIncludes, split queries, reference navigation
GroupBy translationMore complex grouping/query compositions translatedReporting, per-group top rows
No-op CAST removalCleaner predicates and potentially better index useFiltered queries, converted properties
MinBy()/MaxBy()Retrieve the entity at the key extremumOldest/newest, highest/lowest entity by metric

Summary

.NET 11 makes LINQ joins more expressive with FullJoin() and tuple-returning overloads for Join() and GroupJoin(). EF Core 11 connects these capabilities to database queries and improves translation in a range of scenarios, including full joins, grouping, redundant join removal, no-op cast cleanup, MinBy()/MaxBy(), JSON path queries, vector search, and SQL Server JSON collection translation.

The key takeaway: write clear LINQ first, understand whether it runs in memory or is translated by a provider, inspect the SQL for database-backed queries, and benchmark important paths with your real data.

Skills Tutorials

Learn • Build • Grow Together

Official references