Start Debugging

EF Core 11 cheat sheet

The parts of EF Core 11 worth remembering.

This pillar is a running index of everything I’ve written about EF Core 11 - new query features, vector search over DiskANN indexes, performance work, and migration notes coming from EF Core 8, 9, or 10.

What to read first

For the headline 11.0 features, start with EF Core 11 Adds Native SQL Server Vector Search with DiskANN Indexes and EF Core 11 turns on Cosmos DB transactional batches by default - both reshape how you model write paths.

For day-to-day query work, EF Core 11 Prunes Unnecessary Reference Joins in Split Queries and EF Core 11 translates Contains to JSON_CONTAINS on SQL Server 2025 are the changes you’re most likely to feel in generated SQL.

What’s on this page

The list below auto-collects posts tagged with any of: ef-core, ef-core-11, efcore, efcore-11, entity-framework. Newest first.

Index (22 posts)

2026 / 05

2026 / 04

  • How to warm up EF Core's model before the first query

    EF Core builds its conceptual model lazily on the first DbContext access, which is why the first query in a fresh process is several hundred milliseconds slower than every query after it. This guide covers the three real fixes in EF Core 11: a startup IHostedService that touches Model and opens a connection, dotnet ef dbcontext optimize to ship a precompiled model, and the cache-key footguns that silently rebuild the model anyway.

  • How to mock DbContext without breaking change tracking

    Mocking DbContext directly silently breaks ChangeTracker, which is why Microsoft discourages it. This guide shows the two patterns that actually work in EF Core 11: SQLite in-memory with a kept-open connection so the real ChangeTracker runs, and the repository pattern that lifts EF Core out of the test entirely.

  • EF Core 11 Preview 3 Adds RemoveDbContext for Clean Test Provider Swaps

    EF Core 11 Preview 3 introduces RemoveDbContext, RemoveExtension, and a parameterless AddPooledDbContextFactory overload, removing the boilerplate around swapping providers in tests and centralizing pooled factory configuration.

  • How to use IAsyncEnumerable<T> with EF Core 11

    EF Core 11 queries implement IAsyncEnumerable<T> directly. Here is how to stream rows with await foreach, when to prefer it over ToListAsync, and the gotchas around connections, tracking, and cancellation.

  • How to use records with EF Core 11 correctly

    A practical guide to mixing C# records and EF Core 11. Where records fit, where they break change tracking, and how to model value objects, entities, and projections without fighting the framework.

  • EF Core 11 translates Contains to JSON_CONTAINS on SQL Server 2025

    EF Core 11 auto-translates LINQ Contains over JSON collections to the new SQL Server 2025 JSON_CONTAINS function, and adds EF.Functions.JsonContains for path-scoped and mode-specific queries that can hit a JSON index.

  • EF Core 11 Prunes Unnecessary Reference Joins in Split Queries

    EF Core 11 Preview 3 removes redundant to-one joins from split queries and drops unneeded ORDER BY keys. One reported scenario got 29% faster, another 22%. Here is what the SQL now looks like.

  • EF Core 11 Adds GetEntriesForState to Skip DetectChanges

    EF Core 11 Preview 3 introduces ChangeTracker.GetEntriesForState, a state-filtered enumerator that avoids an extra DetectChanges pass in hot paths like SaveChanges interceptors and audit hooks.

  • EF Core 11 turns on Cosmos DB transactional batches by default

    EF Core 11 groups Cosmos DB writes into transactional batches per container and partition on every SaveChanges, giving best-effort atomicity and fewer roundtrips without any code changes.

  • EF Core 11 Lets You Create and Apply a Migration in One Command

    The dotnet ef database update command now accepts --add to scaffold and apply a migration in a single step. Here is how it works, why it matters for containers and .NET Aspire, and what to watch for.

  • EF Core 11 Adds Native SQL Server Vector Search with DiskANN Indexes

    EF Core 11 Preview 2 supports SQL Server 2025 VECTOR_SEARCH() and DiskANN vector indexes directly from LINQ. Here is how to set up the index, run approximate queries, and what changes from the EF Core 10 VectorDistance approach.

2023 / 06

All pillars Home