From cfa0e9dd31699ff0a8f21550ce39fa5ba41ac5d7 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 15 Apr 2026 13:01:26 +0300 Subject: [PATCH 01/36] Convert the docs generation custom agent to a skill (#5332) --- .../skills/generate-docs/SKILL.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) rename .github/agents/docs-generator.agent.md => .agents/skills/generate-docs/SKILL.md (87%) diff --git a/.github/agents/docs-generator.agent.md b/.agents/skills/generate-docs/SKILL.md similarity index 87% rename from .github/agents/docs-generator.agent.md rename to .agents/skills/generate-docs/SKILL.md index e1170eba9d..edfce319de 100644 --- a/.github/agents/docs-generator.agent.md +++ b/.agents/skills/generate-docs/SKILL.md @@ -1,12 +1,11 @@ --- -name: EF Documentation Generator -description: This agent creates documentation PRs in the EF documentation site when new features are implemented in EF Core. -disable-model-invocation: true +name: Generate EF documentation +description: Create documentation PRs in the EF documentation site when new features are implemented in EF Core. --- # Document new EF features -Given an EF issue by the user, this custom agent generates documentation for features introduced in that issue and submits a PR to the EF docs repo (dotnet/EntityFramework.Docs). +Given an EF issue and/or PR, this skill generates documentation for features introduced in that issue/PR and submits a PR to the EF docs repo (dotnet/EntityFramework.Docs). ## Target branch From 90db92afb9c5418a85cb11c04b68452b6bd00e94 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:15:50 -0700 Subject: [PATCH 02/36] Document migration locking (#5330) Fixes #4783 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- .../managing-schemas/migrations/applying.md | 23 ++++++++++++++++++- .../core/modeling/data-seeding.md | 2 +- .../core/providers/sqlite/limitations.md | 22 +++++++++++++++--- .../core/what-is-new/ef-core-9.0/whatsnew.md | 2 ++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/entity-framework/core/managing-schemas/migrations/applying.md b/entity-framework/core/managing-schemas/migrations/applying.md index b20af256d4..15db8f7460 100644 --- a/entity-framework/core/managing-schemas/migrations/applying.md +++ b/entity-framework/core/managing-schemas/migrations/applying.md @@ -2,7 +2,7 @@ title: Applying Migrations - EF Core description: Strategies for applying schema migrations to production and development databases using Entity Framework Core author: SamMonoRT -ms.date: 10/29/2024 +ms.date: 04/16/2026 uid: core/managing-schemas/migrations/applying ms.custom: sfi-ropc-nochange --- @@ -341,3 +341,24 @@ Note that `MigrateAsync()` builds on top of the `IMigrator` service, which can b > > * Carefully consider before using this approach in production. Experience has shown that the simplicity of this deployment strategy is outweighed by the issues it creates. Consider generating SQL scripts from migrations instead. > * Don't call `EnsureCreatedAsync()` before `MigrateAsync()`. `EnsureCreatedAsync()` bypasses Migrations to create the schema, which causes `MigrateAsync()` to fail. + +## Migration locking + +Starting with EF Core 9, and automatically acquire a database-wide lock before applying any migrations. This protects against database corruption that could result from multiple application instances running migrations concurrently, which is a common scenario when [applying migrations at runtime](#apply-migrations-at-runtime). The lock is held for the duration of the migration execution, including any [seeding code](xref:core/modeling/data-seeding#use-seeding-method), and is automatically released when the operation completes. + +Migration locking applies when migrations are applied using any of the following methods: + +* `dotnet ef database update` (.NET CLI) +* `Update-Database` (Package Manager Console) +* [Migration bundles](#bundles) +* and (runtime migration) + +[SQL scripts](#sql-scripts) are not affected by migration locking, since they are applied outside of EF Core. + +> [!WARNING] +> The locking mechanism varies significantly across database providers and can involve provider-specific issues. For example, the SQLite provider uses a lock table that can become [abandoned if the process terminates unexpectedly](xref:core/providers/sqlite/limitations#concurrent-migrations-protection). Always consult your provider's documentation for details. + +### Limitations + +* Wrapping in an explicit transaction is not supported. See [Exception is thrown when applying migrations in an explicit transaction](xref:core/what-is-new/ef-core-9.0/breaking-changes#migrations-transaction) for details. +* On SQLite, abandoned migration locks can [block subsequent migrations](xref:core/providers/sqlite/limitations#concurrent-migrations-protection). diff --git a/entity-framework/core/modeling/data-seeding.md b/entity-framework/core/modeling/data-seeding.md index 218eb4400b..921156e381 100644 --- a/entity-framework/core/modeling/data-seeding.md +++ b/entity-framework/core/modeling/data-seeding.md @@ -21,7 +21,7 @@ There are several ways this can be accomplished in EF Core: ## Configuration options `UseSeeding` and `UseAsyncSeeding` methods -EF 9 introduced and methods, which provide a convenient way of seeding the database with initial data. These methods aim to improve the experience of using custom initialization logic (explained below). They provide one clear location where all the data seeding code can be placed. Moreover, the code inside and methods is protected by the [migration locking mechanism](/ef/core/what-is-new/ef-core-9.0/whatsnew#concurrent-migrations) to prevent concurrency issues. +EF 9 introduced and methods, which provide a convenient way of seeding the database with initial data. These methods aim to improve the experience of using custom initialization logic (explained below). They provide one clear location where all the data seeding code can be placed. Moreover, the code inside and methods is protected by the [migration locking mechanism](xref:core/managing-schemas/migrations/applying#migration-locking) to prevent concurrency issues. The new seeding methods are called as part of operation, and `dotnet ef database update` command, even if there are no model changes and no migrations were applied. diff --git a/entity-framework/core/providers/sqlite/limitations.md b/entity-framework/core/providers/sqlite/limitations.md index 6107b6fce7..4ce6c2fee6 100644 --- a/entity-framework/core/providers/sqlite/limitations.md +++ b/entity-framework/core/providers/sqlite/limitations.md @@ -2,7 +2,7 @@ title: SQLite Database Provider - Limitations - EF Core description: Limitations of the Entity Framework Core SQLite database provider as compared to other providers author: SamMonoRT -ms.date: 11/15/2021 +ms.date: 04/16/2026 uid: core/providers/sqlite/limitations --- # SQLite EF Core Database Provider Limitations @@ -92,9 +92,25 @@ dotnet ef database update --connection "Data Source=My.db" ## Concurrent migrations protection -EF9 introduced a locking mechanism when executing migrations. It aims to protect against multiple migration executions happening simultaneously, as that could leave the database in a corrupted state. This is one of the potential problems resulting from applying migrations at runtime using the method (see [Applying migrations](xref:core/managing-schemas/migrations/applying) for more information). To mitigate this, EF creates an exclusive lock on the database before any migration operations are applied. +EF9 introduced a [migration locking mechanism](xref:core/managing-schemas/migrations/applying#migration-locking) to protect against concurrent migration executions. Unlike SQL Server, which uses a session-level application lock (`sp_getapplock`) that is automatically released when the connection closes, SQLite doesn't have built-in application locks. EF Core instead creates a `__EFMigrationsLock` table and inserts a row to acquire the lock. -Unfortunately, SQLite does not have built-in locking mechanism, so EF Core creates a separate table (`__EFMigrationsLock`) and uses it for locking. The lock is released when the migration completes and the seeding code finishes execution. However, if for some reason migration fails in a non-recoverable way, the lock may not be released correctly. If this happens, consecutive migrations will be blocked from executing SQL and therefore never complete. You can manually unblock them by deleting the `__EFMigrationsLock` table in the database. +### Handling abandoned locks + +If the application terminates unexpectedly (for example, the process is killed during migration), the lock row in the `__EFMigrationsLock` table may not be cleaned up. This prevents any subsequent migration from completing, because each attempt will wait indefinitely for the lock to be released. + +To resolve an abandoned lock, drop the `__EFMigrationsLock` table from the database: + +```sql +DROP TABLE "__EFMigrationsLock"; +``` + +Or, alternatively, delete all rows from the table: + +```sql +DELETE FROM "__EFMigrationsLock"; +``` + +After clearing the lock, subsequent migration operations proceed normally. The table is automatically recreated as needed. ## See also diff --git a/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md index 001f1c8931..a0079a4672 100644 --- a/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md @@ -1088,6 +1088,8 @@ The above were only some of the more important query improvements in EF9; see [t EF9 introduces a locking mechanism to protect against multiple migration executions happening simultaneously, as that could leave the database in a corrupted state. This doesn't happen when migrations are deployed to the production environment using [recommended methods](/ef/core/managing-schemas/migrations/applying#sql-scripts), but can happen if migrations are applied at runtime using the [`DbContext.Database.MigrateAsync()`](/dotnet/api/microsoft.entityframeworkcore.relationaldatabasefacadeextensions.migrate) method. We recommend applying migrations at deployment, rather than as part of application startup, but that can result in more complicated application architectures (e.g. [when using .NET Aspire projects](/dotnet/aspire/database/ef-core-migrations)). +For more information, see [Migration locking](/ef/core/managing-schemas/migrations/applying#migration-locking). + > [!NOTE] > If you are using Sqlite database, see [potential issues associated with this feature](/ef/core/providers/sqlite/limitations#concurrent-migrations-protection). From a8a5753776f99f805f1a1a1c90156ccb5f731ca7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 09:32:01 +0300 Subject: [PATCH 03/36] Document ToTable(null, buildAction) breaking change in EF Core 7.0 (#5338) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- .../ef-core-7.0/breaking-changes.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/entity-framework/core/what-is-new/ef-core-7.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-7.0/breaking-changes.md index 8d59f6d5fb..3bc5abfc5e 100644 --- a/entity-framework/core/what-is-new/ef-core-7.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-7.0/breaking-changes.md @@ -33,6 +33,7 @@ EF Core 7.0 targets .NET 6. This means that existing applications that target .N | [Navigations from new entities to deleted entities are not fixed up](#deleted-fixup) | Low | | [Using `FromSqlRaw` and related methods from the wrong provider throws](#use-the-correct-method) | Low | | [Scaffolded `OnConfiguring` no longer calls `IsConfigured`](#is-configured) | Low | +| [`ToTable(null, ...)` throws `ArgumentNullException`](#totable-null) | Low | ## High-impact changes @@ -573,3 +574,42 @@ Either: - Use the `--no-onconfiguring` (.NET CLI) or `-NoOnConfiguring` (Visual Studio Package Manager Console) argument when scaffolding from an existing database. - [Customize the T4 templates](xref:core/managing-schemas/scaffolding/templates) to add back the call to `IsConfigured`. + + + +### `ToTable(null, ...)` throws `ArgumentNullException` + +[Tracking Issue #19811](https://github.com/dotnet/efcore/issues/19811) + +#### Old behavior + +In EF Core 6.0, calling `.ToTable((string)null, t => t.ExcludeFromMigrations())` was a valid way to configure a keyless entity type that is not mapped to a table and excluded from migrations. For example: + +```csharp +modelBuilder.Entity().HasNoKey().ToTable((string)null, t => t.ExcludeFromMigrations()); +``` + +#### New behavior + +Starting with EF Core 7.0, calling `.ToTable((string)null, ...)` with the `Action` overload throws a `System.ArgumentNullException` because the `name` parameter is no longer nullable. + +#### Why + +This is a side effect of the changes made to support [table facets configuration](https://github.com/dotnet/efcore/issues/19811), which restructured the `ToTable` overloads. + +#### Mitigations + +Split the two calls. First, configure the table facets using the table builder overload (without specifying a null name), and then unmap the entity type from the table: + +```csharp +modelBuilder.Entity( + entityBuilder => + { + entityBuilder.HasNoKey(); + entityBuilder.ToTable(t => t.ExcludeFromMigrations()); + entityBuilder.ToTable((string?)null); + }); +``` + +> [!NOTE] +> Calling `.ToTable(t => t.ExcludeFromMigrations())` will map the entity type to its default table, so migrations will ignore it. However, querying the entity type will try to query the default table unless you also configure it with `ToView` or another mapping override. Calling `.ToTable((string?)null)` afterward unmaps it from the table. From 3098769106755209f757817733b41a23e0820e42 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 22 Apr 2026 16:17:03 +0200 Subject: [PATCH 04/36] Add EF9 breaking change for EF.Constant/EF.Parameter in compiled queries (#5341) Document that EF.Constant() and EF.Parameter() no longer work inside compiled queries (EF.CompileQuery/EF.CompileAsyncQuery) starting with EF Core 9, due to the reimplementation of EF.Constant to avoid query cache misses (dotnet/efcore#33674). Reported by user in dotnet/efcore#38150. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ef-core-9.0/breaking-changes.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md index 33c5838232..b0e76a7f4c 100644 --- a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md @@ -34,6 +34,7 @@ EF Core 9 targets .NET 8. This means that existing applications that target .NET | [`ToString()` method now returns empty string for `null` instances](#nullable-tostring) | Low | | [Shared framework dependencies were updated to 9.0.x](#shared-framework-dependencies) | Low | | [EF tools no longer support .NET Framework projects](#ef-tools-no-netfx) | Low | +| [`EF.Constant()` and `EF.Parameter()` no longer work inside compiled queries](#ef-constant-compiled) | Low | ## High-impact changes @@ -356,6 +357,38 @@ The current version of EF Core tools works with all supported EF Core versions a Update your project to target .NET (e.g., .NET 8 or later). If your project currently targets .NET Framework, see the [porting guide](/dotnet/core/porting/) for information on migrating to .NET. + + +### `EF.Constant()` and `EF.Parameter()` no longer work inside compiled queries + +[Tracking Issue #33674](https://github.com/dotnet/efcore/issues/33674) + +#### Old behavior + +In EF Core 8, and could be used inside compiled queries ( and ): + +```csharp +var lookbackDays = 7; + +var compiledQuery = EF.CompileAsyncQuery( + (AppDbContext db) => db.Blogs + .Where(b => b.PublishedOn >= DateTime.Today.AddDays(EF.Constant(-lookbackDays)))); +``` + +#### New behavior + +Starting with EF Core 9.0, using or inside a compiled query throws an `InvalidCastException`: + +> :::no-loc text="Unable to cast object of type 'System.Linq.Expressions.ConstantExpression' to type 'System.Linq.Expressions.ParameterExpression'."::: + +#### Why + +The internal implementation of was changed to avoid full query recompilation for each different constant value. The previous implementation introduced constant nodes early in the query pipeline (before query caching), causing expensive cache misses whenever a different value was passed to `EF.Constant()`. The new implementation processes these methods at a later stage, which is incompatible with compiled queries. + +#### Mitigations + +Either remove the or call from the compiled query, or stop using a compiled query for that particular query. Note that removing `EF.Constant()` causes the value to be sent as a SQL parameter rather than inlined as a constant, which may affect query plan performance. + ## Azure Cosmos DB breaking changes Extensive work has gone into making the Azure Cosmos DB provider better in 9.0. The changes include a number of high-impact breaking changes; if you are upgrading an existing application, please read the following carefully. From 33a6ce6451fb223e7bce742bdd198e34f39b9654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Thu, 23 Apr 2026 21:10:39 +0200 Subject: [PATCH 05/36] Add standup (#5344) --- .../core/learn-more/community-standups.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index d53d04be43..e974625ff9 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -14,6 +14,7 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday | Date | Area | Title | |--------------|-----------------------|------------------------------------------------------------------------------------------| +| Apr 23, 2026 | Tools | [Lightweight Framework to Automate EF Components](#Apr23_2026) | | Mar 19, 2026 | DevArt | [How dotConnect + Entity Developer simplify your workflow](#Mar19_2026) | | Feb 12, 2026 | AI | [Adam tells us about Microsoft.Extensions.DataIngestion](#Feb12_2026) | | Nov 20, 2025 | Release | [EF 10 release celebration 🎉](#Nov20_2025) | @@ -110,6 +111,22 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday ## 2026 + + +### Apr 23: [Lightweight Framework to Automate EF Components](https://www.youtube.com/live/qTE6_VAMzS4?si=Q3lqINl3l_NQj4Mf) + +Join us for a stream where Klaus Kirchhoff introduces "Lightweight Framework to Automate EF Components". + +Featuring: + +- [Klaus Kirchhoff](https://jobbots24.de/) (Special guest) +- [Jiri Cincura](https://www.tabsoverspaces.com/) (Host) +- [Shay Rojansky](https://www.roji.org/) (Host) + +Links: + +- [jb24-DbFactory](https://jobbots24.de/#section3) + ### Mar 19: [How dotConnect + Entity Developer simplify your workflow](https://www.youtube.com/live/2QX2qHvGbCE?si=xikIyOFYi3eTXLVx) From 135128b71cb94f1349c34a572aeaa3cc40e3b876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= <41551019+AndreqGav@users.noreply.github.com> Date: Fri, 8 May 2026 03:41:03 +0300 Subject: [PATCH 06/36] Add EFCore.Migrations.AutoComments and EFCore.Migrations.CustomSql extensions (#5347) --- entity-framework/core/extensions/index.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entity-framework/core/extensions/index.md b/entity-framework/core/extensions/index.md index 846940f9ec..c5a7297b46 100644 --- a/entity-framework/core/extensions/index.md +++ b/entity-framework/core/extensions/index.md @@ -304,6 +304,18 @@ All xml summaries of entities, properties, and enums will be added as comments o [GitHub repository](https://github.com/roohial57/DotNetComponent_EFCommenter) | [NuGet](https://www.nuget.org/packages/EFCommenter) +### EFCore.Migrations.AutoComments + +Automatically applies database comments to tables and columns from XML `` tags. For EF Core: 6-10. + +[GitHub repository](https://github.com/AndreqGav/EFCore.Migrations.AutoComments) | [NuGet](https://www.nuget.org/packages/EFCore.Migrations.AutoComments) + +### EFCore.Migrations.CustomSql + +Tracks custom SQL and database objects (views, functions, triggers, etc.) as part of the EF model with auto-generated Up/Down migration code. Provider packages add support for specific database engines. For EF Core: 6-9. + +[GitHub repository](https://github.com/AndreqGav/EFCore.Migrations.CustomSql) | [NuGet](https://www.nuget.org/packages/EFCore.Migrations.CustomSql) + ## API Integrations These packages are designed to integrate directly with EF Core to expose various APIs. From 7d9662675ee710314c02df75dc31554df78eb145 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 08:47:26 -0700 Subject: [PATCH 07/36] Add provider-facing breaking change for JsonPath (PR #38038) to EF Core 11 (#5324) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- .../core/what-is-new/ef-core-11.0/provider-facing-changes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md index 34972144d9..719b378cec 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md @@ -2,7 +2,7 @@ title: Provider-facing changes in EF Core 11 (EF11) - EF Core description: List of provider-facing changes introduced in Entity Framework Core 11 (EF11) author: roji -ms.date: 01/16/2026 +ms.date: 04/08/2026 uid: core/what-is-new/ef-core-11.0/provider-facing-changes --- @@ -13,7 +13,9 @@ This page documents noteworthy changes in EF Core 11 which may affect EF provide ## Changes * Collation names are now quoted in SQL, like column and table names ([see #37462](https://github.com/dotnet/efcore/issues/37462)). If your database doesn't support collation name quoting, override `QuerySqlGenerator.VisitSql()` and `MigrationsSqlGenerator.ColumnDefinition()` to revert to the previous behavior, but it's recommended to implement some sort of restricted character validation. +* The `JsonPath` property on `IColumnModification` and `ColumnModificationParameters` has changed from `string?` to the new structured `JsonPath` type ([PR #38038](https://github.com/dotnet/efcore/pull/38038)). The `JsonPath` class provides `Segments`, `Ordinals`, an `IsRoot` property, and an `AppendTo(StringBuilder)` method for rendering the JSONPATH string. Providers that override `UpdateSqlGenerator.AppendUpdateColumnValue()` or otherwise handle JSON partial updates should update their code to use this new type. Where previously you checked for `null` or `"$"`, use `JsonPath is not { IsRoot: false }` instead, and call `JsonPath.AppendTo(stringBuilder)` to write the JSONPATH string representation. ## Test changes * The inheritance specification tests have been reorganized into a folder of their own ([PR](https://github.com/dotnet/efcore/pull/37410)). +* Query test classes now support non-shared-model tests via a new `QueryFixtureBase` class that all query fixtures extend ([PR #37681](https://github.com/dotnet/efcore/pull/37681)). The previous pattern of extending `SharedStoreFixtureBase` and `IQueryFixtureBase` separately has been replaced. `NonSharedPrimitiveCollectionsQueryTestBase` has been merged into `PrimitiveCollectionsQueryTestBase`, and per-type array tests have been moved to `TypeTestBase.Primitive_collection_in_query`. From 33fdddd0a1ff68f419f34df52b690779055fb272 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 9 Apr 2026 11:47:33 +0300 Subject: [PATCH 08/36] Update docs for EF Core 11 full-text/vector API renames (#5315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update documentation to reflect API changes from dotnet/efcore#37993: - SqlServerFullTextIndexBuilder: HasKeyIndex→UseKeyIndex, OnCatalog→UseCatalog, WithChangeTracking→HasChangeTracking, HasLanguage→UseLanguage - FreeTextTable/ContainsTable: columnSelector moved after search text (now optional) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../providers/sql-server/full-text-search.md | 24 +++++++++---------- .../core/what-is-new/ef-core-11.0/whatsnew.md | 8 +++---- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/entity-framework/core/providers/sql-server/full-text-search.md b/entity-framework/core/providers/sql-server/full-text-search.md index 54153a9fe7..abdba6496a 100644 --- a/entity-framework/core/providers/sql-server/full-text-search.md +++ b/entity-framework/core/providers/sql-server/full-text-search.md @@ -31,23 +31,23 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity
() .HasFullTextIndex(a => a.Contents) - .HasKeyIndex("PK_Articles") - .OnCatalog("ftCatalog"); + .UseKeyIndex("PK_Articles") + .UseCatalog("ftCatalog"); } ``` -The `HasKeyIndex()` method specifies the unique, non-nullable, single-column index used as the full-text key for the table (typically the primary key index). `OnCatalog()` assigns the full-text index to a specific catalog. +The `UseKeyIndex()` method specifies the unique, non-nullable, single-column index used as the full-text key for the table (typically the primary key index). `UseCatalog()` assigns the full-text index to a specific catalog. You can also configure multiple columns and additional options such as per-column languages and change tracking: ```csharp modelBuilder.Entity
() .HasFullTextIndex(a => new { a.Title, a.Contents }) - .HasKeyIndex("PK_Articles") - .OnCatalog("ftCatalog") - .WithChangeTracking(FullTextChangeTracking.Manual) - .HasLanguage("Title", "English") - .HasLanguage("Contents", "French"); + .UseKeyIndex("PK_Articles") + .UseCatalog("ftCatalog") + .HasChangeTracking(FullTextChangeTracking.Manual) + .UseLanguage("Title", "English") + .UseLanguage("Contents", "French"); ``` The full-text catalog can also be configured as the default catalog, and with accent sensitivity: @@ -185,7 +185,7 @@ The above automatically searches across all columns registered for full-text sea ```csharp var results = await context.Articles .Join( - context.Articles.FreeTextTable(a => a.Contents, "veggies"), + context.Articles.FreeTextTable("veggies", a => a.Contents), a => a.Id, ftt => ftt.Key, (a, ftt) => new { Article = a, ftt.Rank }) @@ -197,7 +197,7 @@ var results = await context.Articles ```csharp var results = await context.Articles - .FreeTextTable(a => new { a.Title, a.Contents }, "veggies") + .FreeTextTable("veggies", a => new { a.Title, a.Contents }) .Select(r => new { Article = r.Value, Rank = r.Rank }) .OrderByDescending(r => r.Rank) .ToListAsync(); @@ -224,7 +224,7 @@ Both table-valued functions support a `topN` parameter to limit the number of re ```csharp var results = await context.Articles - .FreeTextTable(a => a.Contents, "veggies", topN: 10) + .FreeTextTable("veggies", a => a.Contents, topN: 10) .Select(r => new { Article = r.Value, Rank = r.Rank }) .OrderByDescending(r => r.Rank) .ToListAsync(); @@ -236,7 +236,7 @@ Both table-valued functions support specifying a language term for linguistic ma ```csharp var results = await context.Articles - .FreeTextTable(a => a.Contents, "veggies", languageTerm: "English") + .FreeTextTable("veggies", a => a.Contents, languageTerm: "English") .Select(r => new { Article = r.Value, Rank = r.Rank }) .ToListAsync(); ``` diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 1783c0a7a6..5a433de4d0 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -283,8 +283,8 @@ modelBuilder.HasFullTextCatalog("ftCatalog"); modelBuilder.Entity() .HasFullTextIndex(b => b.FullName) - .HasKeyIndex("PK_Blogs") - .OnCatalog("ftCatalog"); + .UseKeyIndex("PK_Blogs") + .UseCatalog("ftCatalog"); ``` This generates the following SQL in a migration: @@ -307,14 +307,14 @@ However, SQL Server also has table-valued function versions of these functions, ```csharp // Using FreeTextTable with a search query var results = await context.Blogs - .FreeTextTable(b => b.FullName, "John") + .FreeTextTable("John", b => b.FullName) .Select(r => new { Blog = r.Value, Rank = r.Rank }) .OrderByDescending(r => r.Rank) .ToListAsync(); // Using ContainsTable with a search query var results = await context.Blogs - .ContainsTable(b => b.FullName, "John") + .ContainsTable("John", b => b.FullName) .Select(r => new { Blog = r.Value, Rank = r.Rank }) .OrderByDescending(r => r.Rank) .ToListAsync(); From 83778bfe09c7640be04e8b35987a6e4a949a37d8 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 16 Apr 2026 10:03:25 +0300 Subject: [PATCH 09/36] Document temporal period properties mapped to CLR properties (#5336) Documents https://github.com/dotnet/efcore/pull/38110 --- .../providers/sql-server/temporal-tables.md | 65 ++++++++++++++++++- .../core/what-is-new/ef-core-11.0/whatsnew.md | 44 +++++++++++++ 2 files changed, 106 insertions(+), 3 deletions(-) diff --git a/entity-framework/core/providers/sql-server/temporal-tables.md b/entity-framework/core/providers/sql-server/temporal-tables.md index 118ccfe778..46ea79edd0 100644 --- a/entity-framework/core/providers/sql-server/temporal-tables.md +++ b/entity-framework/core/providers/sql-server/temporal-tables.md @@ -64,7 +64,7 @@ EXEC(N'CREATE TABLE [Employees] ( ) WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = [' + @historyTableSchema + N'].[EmployeeHistory]))'); ``` -Notice that SQL Server creates two hidden `datetime2` columns called `PeriodEnd` and `PeriodStart`. These "period columns" represent the time range during which the data in the row existed. These columns are mapped to [shadow properties](xref:core/modeling/shadow-properties) in the EF Core model, allowing them to be used in queries as shown later. +Notice that SQL Server creates two hidden `datetime2` columns called `PeriodEnd` and `PeriodStart`. These "period columns" represent the time range during which the data in the row existed. By default, these columns are mapped to [shadow properties](xref:core/modeling/shadow-properties) in the EF Core model, allowing them to be used in queries as shown later. Starting with EF Core 11, period columns can also be [mapped to CLR properties](#mapping-period-columns-to-clr-properties) on your entity type. > [!IMPORTANT] > The times in these columns are always UTC time generated by SQL Server. UTC times are used for all operations involving temporal tables, such as in the queries shown below. @@ -148,7 +148,7 @@ context.SaveChanges(); --> [!code-csharp[NormalQuery](../../../../samples/core/Miscellaneous/NewInEFCore6/TemporalTablesSample.cs?name=NormalQuery)] -Also, after a normal [tracking query](xref:core/querying/tracking#no-tracking-queries), the values from the period columns of the current data can be [accessed from the tracked entities](xref:core/change-tracking/entity-entries). For example: +Also, after a normal [tracking query](xref:core/querying/tracking#no-tracking-queries), the values from the period columns of the current data can be [accessed from the tracked entities](xref:core/change-tracking/entity-entries). If the period columns are mapped to CLR properties, you can access them directly on the entity; otherwise, use `EF.Property` to access them as shadow properties. For example: [!code-csharp[TemporalAll](../../../../samples/core/Miscellaneous/NewInEFCore6/TemporalTablesSample.cs?name=TemporalAll)] -Notice how the [EF.Property method](xref:core/modeling/shadow-properties#accessing-shadow-properties) can be used to access values from the period columns. This is used in the `OrderBy` clause to sort the data, and then in a projection to include these values in the returned data. +Notice how the [EF.Property method](xref:core/modeling/shadow-properties#accessing-shadow-properties) can be used to access values from the period columns. This is used in the `OrderBy` clause to sort the data, and then in a projection to include these values in the returned data. If the period columns are [mapped to CLR properties](#mapping-period-columns-to-clr-properties), you can reference them directly in the query instead of using `EF.Property`. This query brings back the following data: @@ -280,3 +280,62 @@ Historical data for Rainbow Dash: Employee Rainbow Dash was 'Wonderbolt' from 8/26/2021 4:43:29 PM to 8/26/2021 4:44:59 PM Employee Rainbow Dash was 'Wonderbolt Trainee' from 8/26/2021 4:44:59 PM to 12/31/9999 11:59:59 PM ``` + +## Mapping period columns to CLR properties + +> [!NOTE] +> This feature is being introduced in EF Core 11, which is currently in preview. + +By default, the period columns in a temporal table are mapped to [shadow properties](xref:core/modeling/shadow-properties) in the EF Core model, meaning they don't need to exist on your .NET entity type. Starting with EF Core 11, you can instead map period columns to regular CLR properties on your entity type, which allows you to access their values directly. + +To do this, add `DateTime` properties for the period start and end to your entity type: + +```csharp +public class Employee +{ + public Guid EmployeeId { get; set; } + public string Name { get; set; } + public string Position { get; set; } + public string Department { get; set; } + public string Address { get; set; } + public decimal AnnualSalary { get; set; } + public DateTime PeriodStart { get; set; } + public DateTime PeriodEnd { get; set; } +} +``` + +Then configure the temporal table to use these properties via a lambda expression: + +```csharp +modelBuilder + .Entity() + .ToTable( + "Employees", + b => b.IsTemporal( + b => + { + b.HasPeriodStart(e => e.PeriodStart); + b.HasPeriodEnd(e => e.PeriodEnd); + })); +``` + +> [!NOTE] +> Period properties are automatically configured with `ValueGenerated.OnAddOrUpdate`, so their values are always generated by SQL Server. You don't need to — and should not — set their values when inserting or updating entities. + +When period columns are mapped to CLR properties, you can access their values directly on the entity instead of using `EF.Property`: + +```csharp +var history = context + .Employees + .TemporalAll() + .Where(e => e.Name == "Rainbow Dash") + .OrderBy(e => e.PeriodStart) + .Select( + e => new + { + Employee = e, + e.PeriodStart, + e.PeriodEnd + }) + .ToList(); +``` diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 5a433de4d0..94e1cf12b3 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -394,6 +394,50 @@ WHERE JSON_CONTAINS([b].[JsonData], 8, N'$.Rating') = 1 For the full `JSON_CONTAINS` SQL Server documentation, see [`JSON_CONTAINS`](/sql/t-sql/functions/json-contains-transact-sql). + + +### Temporal period properties mapped to CLR properties + +Previously, the period properties (`PeriodStart`/`PeriodEnd`) on temporal tables were required to be [shadow properties](xref:core/modeling/shadow-properties), meaning they existed only in the EF model and not as CLR properties on your .NET entity types. Starting with EF Core 11, period properties can now be mapped to regular CLR properties on the entity type, making it easier to access their values directly without using `EF.Property`. + +To map period columns to CLR properties, add `DateTime` properties to your entity type and configure them with the lambda-based `HasPeriodStart`/`HasPeriodEnd` overloads: + +```csharp +public class Employee +{ + public Guid EmployeeId { get; set; } + public string Name { get; set; } + public string Position { get; set; } + public DateTime PeriodStart { get; set; } + public DateTime PeriodEnd { get; set; } +} + +modelBuilder + .Entity() + .ToTable( + "Employees", + b => b.IsTemporal( + b => + { + b.HasPeriodStart(e => e.PeriodStart); + b.HasPeriodEnd(e => e.PeriodEnd); + })); +``` + +Once period properties are mapped to CLR properties, you can reference them directly in LINQ queries — for example, in `OrderBy`, `Select`, or `Where` clauses — without needing `EF.Property`: + +```csharp +var history = context.Employees + .TemporalAll() + .OrderBy(e => e.PeriodStart) + .Select(e => new { e.Name, e.PeriodStart, e.PeriodEnd }) + .ToList(); +``` + +Period properties remain configured with `ValueGenerated.OnAddOrUpdate`, so their values are always generated by SQL Server and excluded from INSERT and UPDATE statements. + +For more information, see the [full documentation on temporal tables](xref:core/providers/sql-server/temporal-tables#mapping-period-columns-to-clr-properties). + ## Cosmos DB From eec8f0c8244407b502ab1827dc3bf657c502bfec Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Fri, 17 Apr 2026 01:06:27 +0300 Subject: [PATCH 10/36] Document additional DateTimeOffset translations (#5334) Document https://github.com/dotnet/efcore/pull/38076 --- .../core/providers/sql-server/functions.md | 12 ++++++++++-- .../core/what-is-new/ef-core-11.0/whatsnew.md | 12 ++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/entity-framework/core/providers/sql-server/functions.md b/entity-framework/core/providers/sql-server/functions.md index f7dae58129..42ea32ef66 100644 --- a/entity-framework/core/providers/sql-server/functions.md +++ b/entity-framework/core/providers/sql-server/functions.md @@ -1,8 +1,8 @@ --- title: Function Mappings - Microsoft SQL Server Database Provider - EF Core description: Function Mappings of the Microsoft SQL Server database provider -author: SamMonoRT -ms.date: 7/26/2023 +author: roji +ms.date: 4/14/2026 uid: core/providers/sql-server/functions --- # Function Mappings of the Microsoft SQL Server Provider @@ -106,19 +106,26 @@ dateTimeOffset.AddMonths(months) | DATEADD(month, @mo dateTimeOffset.AddSeconds(seconds) | DATEADD(second, @seconds, @dateTimeOffset) dateTimeOffset.AddYears(years) | DATEADD(year, @years, @dateTimeOffset) dateTimeOffset.Date | CONVERT(date, @dateTimeOffset) +dateTimeOffset.DateTime | CONVERT(datetime2, @dateTimeOffset) | EF Core 11.0 dateTimeOffset.Day | DATEPART(day, @dateTimeOffset) dateTimeOffset.DayOfYear | DATEPART(dayofyear, @dateTimeOffset) dateTimeOffset.Hour | DATEPART(hour, @dateTimeOffset) +dateTimeOffset.LocalDateTime | CONVERT(datetime2, @dateTimeOffset AT TIME ZONE CURRENT_TIMEZONE_ID()) | EF Core 11.0 dateTimeOffset.Microsecond | DATEPART(microsecond, @dateTimeOffset) % 1000 | EF Core 10.0 dateTimeOffset.Millisecond | DATEPART(millisecond, @dateTimeOffset) dateTimeOffset.Minute | DATEPART(minute, @dateTimeOffset) dateTimeOffset.Month | DATEPART(month, @dateTimeOffset) dateTimeOffset.Nanosecond | DATEPART(nanosecond, @dateTimeOffset) % 1000 | EF Core 10.0 +dateTimeOffset.Offset.TotalMinutes | CAST(DATEPART(tz, @dateTimeOffset) AS float) | EF Core 11.0 dateTimeOffset.Second | DATEPART(second, @dateTimeOffset) dateTimeOffset.TimeOfDay | CONVERT(time, @dateTimeOffset) +dateTimeOffset.ToOffset(offset) | SWITCHOFFSET(@dateTimeOffset, @offset) | EF Core 11.0 dateTimeOffset.ToUnixTimeSeconds() | DATEDIFF_BIG(second, '1970-01-01T00:00:00.0000000+00:00', @dateTimeOffset) dateTimeOffset.ToUnixTimeMilliseconds() | DATEDIFF_BIG(millisecond, '1970-01-01T00:00:00.0000000+00:00', @dateTimeOffset) +dateTimeOffset.UtcDateTime | CONVERT(datetime2, @dateTimeOffset AT TIME ZONE 'UTC') | EF Core 11.0 dateTimeOffset.Year | DATEPART(year, @dateTimeOffset) +new DateTimeOffset(dateTime) | TODATETIMEOFFSET(@dateTime, '+00:00') | EF Core 11.0 +new DateTimeOffset(dateTime, offset) | TODATETIMEOFFSET(@dateTime, @offset) | EF Core 11.0 DateOnly.FromDateTime(dateTime) | CONVERT(date, @dateTime) dateOnly.AddDays(value) | DATEADD(day, @value, @dateOnly) dateOnly.AddMonths(months) | DATEADD(month, @months, @dateOnly) @@ -143,6 +150,7 @@ EF.Functions.DateFromParts(year, month, day) | DATEFROMPARTS(@yea EF.Functions.DateTime2FromParts(year, month, day, ...) | DATETIME2FROMPARTS(@year, @month, @day, ...) EF.Functions.DateTimeFromParts(year, month, day, ...) | DATETIMEFROMPARTS(@year, @month, @day, ...) EF.Functions.DateTimeOffsetFromParts(year, month, day, ...) | DATETIMEOFFSETFROMPARTS(@year, @month, @day, ...) +EF.Functions.DateTrunc(datepart, value) | DATETRUNC(@datepart, @value) | EF Core 11.0 EF.Functions.IsDate(expression) | ISDATE(@expression) EF.Functions.SmallDateTimeFromParts(year, month, day, ...) | SMALLDATETIMEFROMPARTS(@year, @month, @day, ...) EF.Functions.TimeFromParts(hour, minute, second, ...) | TIMEFROMPARTS(@hour, @minute, @second, ...) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 94e1cf12b3..d445b2a51f 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -438,6 +438,18 @@ Period properties remain configured with `ValueGenerated.OnAddOrUpdate`, so thei For more information, see the [full documentation on temporal tables](xref:core/providers/sql-server/temporal-tables#mapping-period-columns-to-clr-properties). + + +### Additional DateTimeOffset and date/time translations + +EF Core 11 adds several new SQL Server translations for `DateTimeOffset`. Properties such as `DateTime`, `UtcDateTime`, and `LocalDateTime` are now translated, allowing you to access the `DateTime` component directly in your queries: `DateTime` returns the date and time component without converting the offset, while `UtcDateTime` and `LocalDateTime` represent UTC and server-local conversions, respectively. `Offset.TotalMinutes` is also translated, giving access to the offset component, and `ToOffset(offset)` allows converting a `DateTimeOffset` to a different offset via SQL Server's `SWITCHOFFSET`. + +You can also now construct a `DateTimeOffset` from a `DateTime` directly in LINQ queries, using `new DateTimeOffset(dateTime)` or `new DateTimeOffset(dateTime, offset)`, which translates to SQL Server's `TODATETIMEOFFSET` function. + +In addition, `EF.Functions.DateTrunc()` is now available for truncating `DateTime`, `DateTimeOffset`, `DateOnly` and `TimeOnly` values to a specified precision (e.g. day, hour, minute), translating to SQL Server's [`DATETRUNC`](/sql/t-sql/functions/datetrunc-transact-sql) function. + +For the complete list of date/time function translations, see the [SQL Server function mappings page](xref:core/providers/sql-server/functions). + ## Cosmos DB From 4cd36b46c4e33c036110da811baf70f9097633f0 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 17:57:44 -0700 Subject: [PATCH 11/36] docs: Add dotnet-ef JSON config file feature (EF Core 11) (#5342) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- entity-framework/core/cli/dotnet.md | 56 ++++++++++++++++++- .../core/what-is-new/ef-core-11.0/whatsnew.md | 28 +++++++++- 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/entity-framework/core/cli/dotnet.md b/entity-framework/core/cli/dotnet.md index 4d28cf8cb0..1f0e66d35c 100644 --- a/entity-framework/core/cli/dotnet.md +++ b/entity-framework/core/cli/dotnet.md @@ -2,7 +2,7 @@ title: EF Core tools reference (.NET CLI) - EF Core description: Reference guide for the Entity Framework Core .NET CLI tools author: SamMonoRT -ms.date: 11/08/2024 +ms.date: 04/22/2026 uid: core/cli/dotnet --- @@ -386,6 +386,60 @@ The following example creates a script for all migrations after the InitialCreat dotnet ef migrations script 20180904195021_InitialCreate ``` +## Configuration file + +> [!NOTE] +> This feature was introduced in EF Core 11. + +Starting with EF Core 11, `dotnet ef` can load default option values from a JSON configuration file. This reduces the need to repeat the same command-line options across multiple invocations. + +### File location and discovery + +Place a file named `dotnet-ef.json` inside a `.config` directory: + +```text +/ +└── .config/ + └── dotnet-ef.json +``` + +When `dotnet ef` runs, it walks up the directory tree from the current working directory and uses the first `.config/dotnet-ef.json` file it finds. This means you can place the file at the root of your repository and it will be used from any subdirectory. + +### Supported properties + +The configuration file is a JSON object with the following optional properties: + +```json +{ + "project": "src/App.Infrastructure", + "startupProject": "src/App.Api", + "framework": "net11.0", + "configuration": "Debug", + "context": "AppDbContext", + "runtime": "win-x64", + "verbose": true, + "noColor": false, + "prefixOutput": false +} +``` + +| Property | Type | Description | +|:-----------------|:--------|:--------------------------------------------------------------------------------------------------------------------------------------------| +| `project` | string | Relative or absolute path to the target project folder. Relative paths are resolved relative to the parent of the `.config` directory containing the file. | +| `startupProject` | string | Relative or absolute path to the startup project folder. Relative paths are resolved relative to the parent of the `.config` directory containing the file. | +| `framework` | string | The [Target Framework Moniker](/dotnet/standard/frameworks#supported-target-framework-versions) for the target framework. | +| `configuration` | string | The build configuration, for example: `Debug` or `Release`. | +| `context` | string | The `DbContext` class to use. Class name only or fully qualified with namespaces. | +| `runtime` | string | The identifier of the target runtime to restore packages for. For a list of Runtime Identifiers (RIDs), see the [RID catalog](/dotnet/core/rid-catalog). | +| `verbose` | boolean | Enable verbose output. | +| `noColor` | boolean | Disable colored console output. | +| `prefixOutput` | boolean | Prefix output lines with their severity level. | + +All properties are optional. Only include the properties you need. + +> [!NOTE] +> Explicit command-line options always take precedence over values from the configuration file. + ## Additional resources * [Migrations](xref:core/managing-schemas/migrations/index) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index d445b2a51f..78900f1671 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -2,7 +2,7 @@ title: What's New in EF Core 11 description: Overview of new features in EF Core 11 author: roji -ms.date: 02/02/2026 +ms.date: 04/22/2026 uid: core/what-is-new/ef-core-11.0/whatsnew --- @@ -631,6 +631,32 @@ Remove-Migration -Offline Drop-Database -Connection "Server=test;Database=MyDb;..." -Force ``` + + +### Configuration file for dotnet ef + +The `dotnet ef` command-line tool now supports loading default option values from a `.config/dotnet-ef.json` configuration file. This eliminates the need to repeatedly specify the same options — such as `--project` and `--startup-project` — across every command invocation. + +When you run `dotnet ef`, the tool searches for a `.config/dotnet-ef.json` file by walking up the directory tree from the current working directory. The first file found is used. Here's an example configuration file: + +```json +{ + "project": "src/App.Infrastructure", + "startupProject": "src/App.Api", + "framework": "net11.0", + "configuration": "Debug", + "context": "AppDbContext", + "runtime": "win-x64", + "verbose": true, + "noColor": false, + "prefixOutput": false +} +``` + +Explicit command-line options always take precedence over configuration file values. Path values for `project` and `startupProject` are resolved relative to the parent of the `.config` directory containing the file. + +For more information, see [Configuration file](xref:core/cli/dotnet#configuration-file). + ## Other improvements * The EF command-line tool now writes all logging and status messages to standard error, reserving standard output only for the command's actual expected output. For example, when generating a migration SQL script with `dotnet ef migrations script`, only the SQL is written to standard output. From cdbbfc83e5700550ef007a964b73325afd064d41 Mon Sep 17 00:00:00 2001 From: Eric Sampson <1183853+ericsampson@users.noreply.github.com> Date: Mon, 18 May 2026 09:57:55 -0500 Subject: [PATCH 12/36] docs: Add EF6 6.5.1 and 6.5.2 patch release notes --- entity-framework/ef6/what-is-new/index.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/entity-framework/ef6/what-is-new/index.md b/entity-framework/ef6/what-is-new/index.md index 2f8ce7a64c..5784c904d9 100644 --- a/entity-framework/ef6/what-is-new/index.md +++ b/entity-framework/ef6/what-is-new/index.md @@ -2,7 +2,7 @@ title: What's new - EF6 description: What's new in Entity Framework 6 author: SamMonoRT -ms.date: 05/17/2024 +ms.date: 05/18/2026 uid: ef6/what-is-new/index --- # What's new in EF6 @@ -11,6 +11,19 @@ We highly recommend that you use the latest released version of Entity Framework However, we realize that you may need to use a previous version, or that you may want to experiment with new improvements in the latest pre-release. To install specific versions of EF, see [Get Entity Framework](xref:ef6/fundamentals/install). +## EF 6.5.2 + +The EF 6.5.2 runtime was released to NuGet in April 2026. See the [release notes](https://github.com/dotnet/ef6/releases/tag/v6.5.2) on GitHub. Notable changes: + +- Compatibility with .NET 10 - ports the .NET 10 first-class span support fix so EF6 continues to work correctly on .NET 10 ([#2365](https://github.com/dotnet/ef6/pull/2365)). +- `Microsoft.Data.SqlClient` was updated to version 5.1.6 ([#2284](https://github.com/dotnet/ef6/pull/2284)). +- Fixed `HierarchyId` parsing for numbers outside the `Int32` range ([#2362](https://github.com/dotnet/ef6/pull/2362)). +- Allow the `ef6` tool to run on the newest .NET SDK ([#2396](https://github.com/dotnet/ef6/pull/2396)). + +## EF 6.5.1 + +The EF 6.5.1 runtime was released to NuGet in June 2024. This patch release fixes a broken NuGet package in 6.5.0 ([#2263](https://github.com/dotnet/ef6/pull/2263)). + ## EF 6.5.0 The EF 6.5.0 runtime was released to NuGet in June 2024. The primary goal of EF 6.5 is to include a new SQL Server / Azure SQL Database provider. See [list of important fixes](https://github.com/dotnet/ef6/milestone/17?closed=1) on Github. Here are some of the more notable ones: From 287af742c8ac487322bccd75672358e413425e9e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 19 May 2026 21:51:13 +0000 Subject: [PATCH 13/36] Fix broken extension-getenumerator link in ef-core-6.0 breaking-changes.md Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/9b344332-4463-4b56-87ba-624d797f5cfe Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --- .../core/what-is-new/ef-core-6.0/breaking-changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/what-is-new/ef-core-6.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-6.0/breaking-changes.md index b8ab08ccfc..19ac4eb3bf 100644 --- a/entity-framework/core/what-is-new/ef-core-6.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-6.0/breaking-changes.md @@ -428,7 +428,7 @@ If your application expects joined entities to be returned in a particular order #### Why - was originally made to implement mainly in order to allow direct enumeration on it via the `foreach` construct. Unfortunately, when a project also references [System.Linq.Async](https://www.nuget.org/packages/System.Linq.Async) in order to compose async LINQ operators client-side, this resulted in an ambiguous invocation error between the operators defined over `IQueryable` and those defined over `IAsyncEnumerable`. C# 9 added [extension `GetEnumerator` support for `foreach` loops](/dotnet/csharp/language-reference/proposals/csharp-9.0/extension-getenumerator), removing the original main reason to reference `IAsyncEnumerable`. + was originally made to implement mainly in order to allow direct enumeration on it via the `foreach` construct. Unfortunately, when a project also references [System.Linq.Async](https://www.nuget.org/packages/System.Linq.Async) in order to compose async LINQ operators client-side, this resulted in an ambiguous invocation error between the operators defined over `IQueryable` and those defined over `IAsyncEnumerable`. C# 9 added [extension `GetEnumerator` support for `foreach` loops](/dotnet/csharp/language-reference/statements/iteration-statements#the-foreach-statement), removing the original main reason to reference `IAsyncEnumerable`. The vast majority of `DbSet` usages will continue to work as-is, since they compose LINQ operators over `DbSet`, enumerate it, etc. The only usages broken are those which attempt to cast `DbSet` directly to `IAsyncEnumerable`. From 9bd144410ee679f7662a33a7752b336d84558fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Fri, 22 May 2026 12:36:47 +0200 Subject: [PATCH 14/36] Add standup (#5363) --- .../core/learn-more/community-standups.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index e974625ff9..d58a0c9b71 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -14,6 +14,7 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday | Date | Area | Title | |--------------|-----------------------|------------------------------------------------------------------------------------------| +| May 21, 2026 | EF Core | [8 Real-World Query Anti-Patterns (and How to Fix Them)](#May21_2026) | | Apr 23, 2026 | Tools | [Lightweight Framework to Automate EF Components](#Apr23_2026) | | Mar 19, 2026 | DevArt | [How dotConnect + Entity Developer simplify your workflow](#Mar19_2026) | | Feb 12, 2026 | AI | [Adam tells us about Microsoft.Extensions.DataIngestion](#Feb12_2026) | @@ -111,6 +112,18 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday ## 2026 + + +### May 21: [8 Real-World Query Anti‑Patterns (and How to Fix Them)](https://www.youtube.com/live/jlR6KFuFODI?si=PSCUNSrqo0-fVDJw) + +Join us for another show, where Chris Woodruff teaches us about 8 query anti-patterns and how to fix them. + +Featuring: + +- [Chris Woodruff](https://woodruff.dev/) (Special guest) +- [Jiri Cincura](https://www.tabsoverspaces.com/) (Host) +- [Shay Rojansky](https://www.roji.org/) (Host) + ### Apr 23: [Lightweight Framework to Automate EF Components](https://www.youtube.com/live/qTE6_VAMzS4?si=Q3lqINl3l_NQj4Mf) From 0766a76bbc036ba6830f67f0deef8f11ec8d330e Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 12:40:05 +0200 Subject: [PATCH 15/36] Fix broken Hot Chocolate EF Core integration link (#5361) * Fix broken ChilliCream Hot Chocolate EF integration link Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/09841280-9b60-47ca-b74b-d3b6b4db8b62 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> * React to PR feedback Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> Co-authored-by: Andriy Svyryd Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- entity-framework/core/learn-more/community-standups.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index d58a0c9b71..770d341b42 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -449,8 +449,8 @@ Featuring: Links: -- Product: [Hot Chocolate for GraphQL](https://chillicream.com/docs/hotchocolate) -- Docs: [Hot Chocolate and Entity Framework Core](https://chillicream.com/docs/hotchocolate/integrations/entity-framework) +- Product: [Hot Chocolate for GraphQL](https://chillicream.com/docs/hotchocolate/v14) +- Docs: [Hot Chocolate and Entity Framework Core](https://chillicream.com/docs/hotchocolate/v14/integrations/entity-framework) From 06753e5aa4e00e1a372ea40cbbfb1e0fa5daa72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Fri, 22 May 2026 12:44:40 +0200 Subject: [PATCH 16/36] Fix hyphen (#5364) --- entity-framework/core/learn-more/community-standups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index 770d341b42..c15b51e5fa 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -114,7 +114,7 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday -### May 21: [8 Real-World Query Anti‑Patterns (and How to Fix Them)](https://www.youtube.com/live/jlR6KFuFODI?si=PSCUNSrqo0-fVDJw) +### May 21: [8 Real-World Query Anti-Patterns (and How to Fix Them)](https://www.youtube.com/live/jlR6KFuFODI?si=PSCUNSrqo0-fVDJw) Join us for another show, where Chris Woodruff teaches us about 8 query anti-patterns and how to fix them. From 527418c4c59a108c14044596112bf549d68c1c02 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 28 May 2026 16:58:51 -0700 Subject: [PATCH 17/36] Change ms.product to ms.service in index.yml (#5367) Updated metadata for .NET data documentation. --- entity-framework/dotnet-data/index.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/dotnet-data/index.yml b/entity-framework/dotnet-data/index.yml index fa791286b6..fbc3a4bfaa 100644 --- a/entity-framework/dotnet-data/index.yml +++ b/entity-framework/dotnet-data/index.yml @@ -7,7 +7,7 @@ brand: dotnet metadata: title: .NET (C#) data documentation center description: This page contains resources about how to work with data using .NET (C#). Use our docs and tutorials to choose from our wide variety of available databases & data access approaches and get started quick! - ms.product: entity-framework + ms.service: entity-framework ms.topic: hub-page author: jcjiang ms.date: 03/08/2023 From 6e94ce1412da5bee374470270ac9e37163cf5498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aykut=20C=C4=B1nc=C4=B1k?= Date: Sat, 23 May 2026 15:33:10 +0300 Subject: [PATCH 18/36] Document parameterless constructor requirement for ApplyConfigurationsFromAssembly - Add a NOTE block in entity-framework/core/modeling/index.md describing the parameterless constructor requirement. - Clarify that the constructor may be public or non-public. - Mention that types without one are skipped and a SkippedEntityTypeConfigurationWarning is logged. - Point readers to ModelBuilder.ApplyConfiguration as the manual alternative. Fixes #3207 --- entity-framework/core/modeling/index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entity-framework/core/modeling/index.md b/entity-framework/core/modeling/index.md index 35b940efa9..579242928a 100644 --- a/entity-framework/core/modeling/index.md +++ b/entity-framework/core/modeling/index.md @@ -42,6 +42,9 @@ It is possible to apply all configuration specified in types implementing `IEnti > [!NOTE] > The order in which the configurations will be applied is undefined, therefore this method should only be used when the order doesn't matter. +> [!NOTE] +> `ApplyConfigurationsFromAssembly` only instantiates configuration types that have a parameterless constructor; the constructor may be public or non-public. Types whose constructors require parameters are skipped, and a `SkippedEntityTypeConfigurationWarning` is logged. To apply such configurations, instantiate them manually and pass them to . + #### Using `EntityTypeConfigurationAttribute` on entity types Rather than explicitly calling `Configure`, an can instead be placed on the entity type such that EF Core can find and use appropriate configuration. For example: From eed241baac501150af13d7838a735026400171b5 Mon Sep 17 00:00:00 2001 From: EduardF1 Date: Sat, 30 May 2026 02:06:22 +0200 Subject: [PATCH 19/36] docs: mention no-pluralize in scaffolding guide Fixes #5112 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- entity-framework/core/managing-schemas/scaffolding/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entity-framework/core/managing-schemas/scaffolding/index.md b/entity-framework/core/managing-schemas/scaffolding/index.md index 4ea02e0f0c..b67a5ca3d1 100644 --- a/entity-framework/core/managing-schemas/scaffolding/index.md +++ b/entity-framework/core/managing-schemas/scaffolding/index.md @@ -136,6 +136,8 @@ Scaffold-DbContext ... -Tables Customer.Purchases, Contractor.Accounts, Contract Table and column names are fixed up to better match the .NET naming conventions for types and properties by default. Specifying `-UseDatabaseNames` (Visual Studio PMC) or `--use-database-names` (.NET CLI) will disable this behavior preserving the original database names as much as possible. Invalid .NET identifiers will still be fixed and synthesized names like navigation properties will still conform to .NET naming conventions. +To disable the pluralizer when scaffolding reverse-engineered models, use `-NoPluralize` (Visual Studio PMC) or `--no-pluralize` (.NET CLI). + For example, consider the following tables: ```sql From 058a5fc662ad8cf19a57ee8af76a3c476517eb51 Mon Sep 17 00:00:00 2001 From: EduardF1 <50618110+EduardF1@users.noreply.github.com> Date: Tue, 2 Jun 2026 03:55:22 +0200 Subject: [PATCH 20/36] docs: fix UsingEntity lambda order in scaffolding sample (#5370) Fixes #5014 --- entity-framework/core/managing-schemas/scaffolding/index.md | 4 ++-- samples/core/Miscellaneous/NewInEFCore6/ScaffoldingSample.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/entity-framework/core/managing-schemas/scaffolding/index.md b/entity-framework/core/managing-schemas/scaffolding/index.md index b67a5ca3d1..92c77a7350 100644 --- a/entity-framework/core/managing-schemas/scaffolding/index.md +++ b/entity-framework/core/managing-schemas/scaffolding/index.md @@ -419,8 +419,8 @@ entity.HasMany(d => d.Tags) .WithMany(p => p.Posts) .UsingEntity>( "PostTag", - l => l.HasOne().WithMany().HasForeignKey("PostsId"), - r => r.HasOne().WithMany().HasForeignKey("TagsId"), + r => r.HasOne().WithMany().HasForeignKey("TagsId"), + l => l.HasOne().WithMany().HasForeignKey("PostsId"), j => { j.HasKey("PostsId", "TagsId"); diff --git a/samples/core/Miscellaneous/NewInEFCore6/ScaffoldingSample.cs b/samples/core/Miscellaneous/NewInEFCore6/ScaffoldingSample.cs index 58f39d147a..11465dab4c 100644 --- a/samples/core/Miscellaneous/NewInEFCore6/ScaffoldingSample.cs +++ b/samples/core/Miscellaneous/NewInEFCore6/ScaffoldingSample.cs @@ -116,8 +116,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Posts) .UsingEntity>( "PostTag", - l => l.HasOne().WithMany().HasForeignKey("PostsId"), - r => r.HasOne().WithMany().HasForeignKey("TagsId"), + r => r.HasOne().WithMany().HasForeignKey("TagsId"), + l => l.HasOne().WithMany().HasForeignKey("PostsId"), j => { j.HasKey("PostsId", "TagsId"); From 653b73da4d16d1d38b73ff10018b214cc1b75ff6 Mon Sep 17 00:00:00 2001 From: Denis Ivanov Date: Tue, 9 Jun 2026 21:54:26 +0300 Subject: [PATCH 21/36] Add DuckDB (#5375) --- entity-framework/core/providers/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/entity-framework/core/providers/index.md b/entity-framework/core/providers/index.md index ac7d696e6a..68299f7b0b 100644 --- a/entity-framework/core/providers/index.md +++ b/entity-framework/core/providers/index.md @@ -64,6 +64,7 @@ Entity Framework Core can access many different databases through plug-in librar | [EFCore.Snowflake](https://www.nuget.org/packages/EFCore.Snowflake/) | Snowflake | [Krzysztof Sielaff](https://github.com/Sielnix) | | 8 | [readme](https://github.com/Sielnix/EFCore.Snowflake/blob/main/README.md) | | [EFCore.Kusto](https://www.nuget.org/packages/EFCore.Kusto/) | Azure Data Explorer (Kusto) | [Anas Ismail Khan](https://github.com/anasik) | | 8 | [readme](https://github.com/anasik/EFCore.Kusto/blob/main/README.md) | | [EntityFrameworkCore.Ydb](https://www.nuget.org/packages/EntityFrameworkCore.Ydb) | YDB | [YDB Team](https://github.com/ydb-platform/) | | 9, 10 | [website](https://ydb.tech/docs/en/integrations/orm/entity-framework?version=main) | +| [DuckDB.EFCore](https://www.nuget.org/packages/DuckDB.EFCore) | DuckDB | [Denis Ivanov](https://github.com/denis-ivanov) | | 10 | [readme](https://github.com/denis-ivanov/DuckDB.EFCore/blob/master/README.md) | ## Adding a database provider to your application From ce1a597aa3c6efeab786e3d0080209bfe95c8861 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 19:05:02 +0000 Subject: [PATCH 22/36] docs: update vector search page date --- entity-framework/core/providers/sql-server/vector-search.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/providers/sql-server/vector-search.md b/entity-framework/core/providers/sql-server/vector-search.md index 608ac0eb0b..48acc81946 100644 --- a/entity-framework/core/providers/sql-server/vector-search.md +++ b/entity-framework/core/providers/sql-server/vector-search.md @@ -2,7 +2,7 @@ title: Microsoft SQL Server Database Provider - Vector Search - EF Core description: Using vectors and embeddings to perform similarity search with the Entity Framework Core Microsoft SQL Server database provider author: roji -ms.date: 08/17/2025 +ms.date: 06/09/2026 uid: core/providers/sql-server/vector-search --- # Vector search in the SQL Server EF Core Provider From b2d6d0cc6f37558b2fc43dd31dda25b276186283 Mon Sep 17 00:00:00 2001 From: Govind Sagar <73192061+GOVINSAGA@users.noreply.github.com> Date: Wed, 10 Jun 2026 01:38:17 +0530 Subject: [PATCH 23/36] Fix heading capitalization to use sentence case for H2+ headings (#5376) Part of #2361 --- entity-framework/core/get-started/winforms.md | 4 ++-- entity-framework/core/get-started/wpf.md | 20 +++++++++---------- .../core/modeling/bulk-configuration.md | 2 +- .../core/modeling/entity-properties.md | 2 +- .../core/modeling/keyless-entity-types.md | 2 +- entity-framework/core/modeling/keys.md | 2 +- entity-framework/core/modeling/spatial.md | 6 +++--- .../core/querying/complex-query-operators.md | 2 +- entity-framework/core/querying/sql-queries.md | 2 +- entity-framework/core/saving/basic.md | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/entity-framework/core/get-started/winforms.md b/entity-framework/core/get-started/winforms.md index 3e339dbada..e9f5f551dc 100644 --- a/entity-framework/core/get-started/winforms.md +++ b/entity-framework/core/get-started/winforms.md @@ -19,7 +19,7 @@ The screen shots and code listings in this walkthrough are taken from Visual Stu You need to have Visual Studio 2022 17.3 or later installed with the **.NET desktop workload** selected to complete this walkthrough. For more information about installing the latest version of Visual Studio, see [Install Visual Studio](/visualstudio/install/install-visual-studio). -## Create the Application +## Create the application 1. Open Visual Studio 2. On the start window, choose **Create new project**. @@ -48,7 +48,7 @@ You need to have Visual Studio 2022 17.3 or later installed with the **.NET desk > [!NOTE] > The **Microsoft.EntityFrameworkCore.Sqlite** is the "database provider" package for using EF Core with a SQLite database. Similar packages are available for other database systems. Installing a database provider package automatically brings in all the dependencies needed to use EF Core with that database system. This includes the **Microsoft.EntityFrameworkCore** base package. -## Define a Model +## Define a model In this walkthrough we will implement a model using "Code First". This means that EF Core will create the database tables and schema based on the C# classes you define. See [Managing Database Schemas](xref:core/managing-schemas/index) to see how to use an existing database instead. diff --git a/entity-framework/core/get-started/wpf.md b/entity-framework/core/get-started/wpf.md index 9b5c5ffa26..cd25e2b6ce 100644 --- a/entity-framework/core/get-started/wpf.md +++ b/entity-framework/core/get-started/wpf.md @@ -17,11 +17,11 @@ The screen shots and code listings in this walkthrough are taken from Visual Stu > [!TIP] > You can view this article's [sample on GitHub](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/WPF). -## Pre-Requisites +## Pre-requisites You need to have Visual Studio 2019 16.3 or later installed with the **.NET desktop workload** selected to complete this walkthrough. For more information about installing the latest version of Visual Studio, see [Install Visual Studio](/visualstudio/install/install-visual-studio). -## Create the Application +## Create the application 1. Open Visual Studio 2. On the start window, choose **Create new project**. @@ -45,7 +45,7 @@ You need to have Visual Studio 2019 16.3 or later installed with the **.NET desk > [!NOTE] > When you installed the Sqlite package, it automatically pulled down the related **Microsoft.EntityFrameworkCore** base package. The **Microsoft.EntityFrameworkCore.Proxies** package provides support for "lazy-loading" data. This means when you have entities with child entities, only the parents are fetched on the initial load. The proxies detect when an attempt to access the child entities is made and automatically loads them on demand. -## Define a Model +## Define a model In this walkthrough you will implement a model using "code first." This means that EF Core will create the database tables and schema based on the C# classes you define. @@ -83,7 +83,7 @@ Press **CTRL+SHIFT+B** or navigate to **Build > Build Solution** to compile t > [!TIP] > Learn about the different was to keep your database and EF Core models in sync: [Managing Database Schemas](xref:core/managing-schemas/index). -## Lazy Loading +## Lazy loading The **Products** property on the **Category** class and **Category** property on the **Product** class are navigation properties. In Entity Framework Core, navigation properties provide a way to navigate a relationship between two entity types. @@ -91,7 +91,7 @@ EF Core gives you an option of loading related entities from the database automa When using "Plain Old C# Object" (POCO) entity types, EF Core achieves lazy loading by creating instances of derived proxy types during runtime and then overriding virtual properties in your classes to add the loading hook. To get lazy loading of related objects, you must declare navigation property getters as **public** and **virtual** (**Overridable** in Visual Basic), and your class must not be **sealed** (**NotOverridable** in Visual Basic). When using Database First, navigation properties are automatically made virtual to enable lazy loading. -## Bind Object to Controls +## Bind object to controls Add the classes that are defined in the model as data sources for this WPF application. @@ -108,7 +108,7 @@ Add the classes that are defined in the model as data sources for this WPF appli 1. Note that the `CategoryId` is set to `ReadOnly` because it is assigned by the database and cannot be changed. -## Adding a Details Grid +## Adding a details grid Now that the grid exists to display categories, the details grid can be added to show products. Add this inside the `Grid` element, after the categories `DataGrid` element. @@ -125,7 +125,7 @@ Your design view should look like this: ![Screenshot of WPF Designer](_static/wpf-tutorial-designer.jpg) -## Add Code that Handles Data Interaction +## Add code that handles data interaction It's time to add some event handlers to the main window. @@ -145,13 +145,13 @@ The code declares a long-running instance of `ProductContext`. The `ProductConte > [!NOTE] > The code uses a call to `EnsureCreated()` to build the database on the first run. This is acceptable for demos, but in production apps you should look at [migrations](xref:core/managing-schemas/migrations/index) to manage your schema. The code also executes synchronously because it uses a local SQLite database. For production scenarios that typically involve a remote server, consider using the asynchronous versions of the `Load` and `SaveChanges` methods. -## Test the WPF Application +## Test the WPF application Compile and run the application by pressing **F5** or choosing **Debug > Start Debugging**. The database should be automatically created with a file named `products.db`. Enter a category name and hit enter, then add products to the lower grid. Click save and watch the grid refresh with the database provided ids. Highlight a row and hit **Delete** to remove the row. The entity will be deleted when you click **Save**. ![Running application](_static/wpf-tutorial-app.jpg) -## Property Change Notification +## Property change notification This example relies on four steps to synchronize the entities with the UI. @@ -165,6 +165,6 @@ This works for our getting started sample, but you may require additional code f > [!TIP] > To learn more about how to handle changes, read: [How to implement property change notification](/dotnet/framework/wpf/data/how-to-implement-property-change-notification). -## Next Steps +## Next steps Learn more about [Configuring a DbContext](xref:core/dbcontext-configuration/index). diff --git a/entity-framework/core/modeling/bulk-configuration.md b/entity-framework/core/modeling/bulk-configuration.md index 56bf6ff4e0..c83fff0524 100644 --- a/entity-framework/core/modeling/bulk-configuration.md +++ b/entity-framework/core/modeling/bulk-configuration.md @@ -25,7 +25,7 @@ Properties of this type are not discovered by default as the current EF provider [!code-csharp[Main](../../../samples/core/Modeling/BulkConfiguration/CurrencyConverter.cs?name=CurrencyConverter)] -### Drawbacks of the Metadata API +### Drawbacks of the metadata API - Unlike [Fluent API](xref:core/modeling/index#use-fluent-api-to-configure-a-model), every modification to the model needs to be done explicitly. For example, if some of the `Currency` properties were configured as navigations by a convention then you need to first remove the navigation referencing the CLR property before adding an entity type property for it. [#9117](https://github.com/dotnet/efcore/issues/9117) will improve this. - The conventions run after each change. If you remove a navigation discovered by a convention then the convention will run again and could add it back. To prevent this from happening you would need to either delay the conventions until after the property is added by calling and later disposing the returned object or to mark the CLR property as ignored using . diff --git a/entity-framework/core/modeling/entity-properties.md b/entity-framework/core/modeling/entity-properties.md index 3f378076b7..9db50d1c8f 100644 --- a/entity-framework/core/modeling/entity-properties.md +++ b/entity-framework/core/modeling/entity-properties.md @@ -78,7 +78,7 @@ In the following example, configuring a maximum length of 500 will cause a colum *** -### Precision and Scale +### Precision and scale Some relational data types support the precision and scale facets; these control what values can be stored, and how much storage is needed for the column. Which data types support precision and scale is database-dependent, but in most databases `decimal` and `DateTime` types do support these facets. For `decimal` properties, precision defines the maximum number of digits needed to express any value the column will contain, and scale defines the maximum number of decimal places needed. For `DateTime` properties, precision defines the maximum number of digits needed to express fractions of seconds, and scale is not used. diff --git a/entity-framework/core/modeling/keyless-entity-types.md b/entity-framework/core/modeling/keyless-entity-types.md index f1c22e0799..627d49b2fa 100644 --- a/entity-framework/core/modeling/keyless-entity-types.md +++ b/entity-framework/core/modeling/keyless-entity-types.md @@ -12,7 +12,7 @@ uid: core/modeling/keyless-entity-types In addition to regular entity types, an EF Core model can contain _keyless entity types_, which can be used to carry out database queries against data that doesn't contain key values. -## Defining Keyless entity types +## Defining keyless entity types Keyless entity types can be defined as follows: diff --git a/entity-framework/core/modeling/keys.md b/entity-framework/core/modeling/keys.md index bbb8ef5bec..50c27ac7c2 100644 --- a/entity-framework/core/modeling/keys.md +++ b/entity-framework/core/modeling/keys.md @@ -72,7 +72,7 @@ Key properties must always have a non-default value when adding a new entity to > [!IMPORTANT] > If a key property has its value generated by the database and a non-default value is specified when an entity is added, then EF will assume that the entity already exists in the database and will try to update it instead of inserting a new one. To avoid this, turn off value generation or see [how to specify explicit values for generated properties](xref:core/modeling/generated-properties#overriding-value-generation). -## Alternate Keys +## Alternate keys An alternate key serves as an alternate unique identifier for each entity instance in addition to the primary key; it can be used as the target of a relationship. When using a relational database this maps to the concept of a unique index/constraint on the alternate key column(s) and one or more foreign key constraints that reference the column(s). diff --git a/entity-framework/core/modeling/spatial.md b/entity-framework/core/modeling/spatial.md index a8a484e7e4..c8a09a55f0 100644 --- a/entity-framework/core/modeling/spatial.md +++ b/entity-framework/core/modeling/spatial.md @@ -52,11 +52,11 @@ There are several spatial data types. Which type you use depends on the types of Using the base Geometry type allows any type of shape to be specified by the property. -## Longitude and Latitude +## Longitude and latitude Coordinates in NTS are in terms of X and Y values. To represent longitude and latitude, use X for longitude and Y for latitude. Note that this is **backwards** from the `latitude, longitude` format in which you typically see these values. -## Querying Data +## Querying data The following entity classes could be used to map to tables in the [Wide World Importers sample database](https://go.microsoft.com/fwlink/?LinkID=800630). @@ -74,7 +74,7 @@ In LINQ, the NTS methods and properties available as database functions will be The spatial NuGet packages also enable [reverse engineering](xref:core/managing-schemas/scaffolding) models with spatial properties, but you need to install the package ***before*** running `Scaffold-DbContext` or `dotnet ef dbcontext scaffold`. If you don't, you'll receive warnings about not finding type mappings for the columns and the columns will be skipped. -## SRID Ignored during client operations +## SRID ignored during client operations NTS ignores SRID values during operations. It assumes a planar coordinate system. This means that if you specify coordinates in terms of longitude and latitude, some client-evaluated values like distance, length, and area will be in degrees, not meters. For more meaningful values, you first need to project the coordinates to another coordinate system using a library like [ProjNet (for GeoAPI)](https://github.com/NetTopologySuite/ProjNet4GeoAPI). diff --git a/entity-framework/core/querying/complex-query-operators.md b/entity-framework/core/querying/complex-query-operators.md index 50309c4a6c..ecfb3a6377 100644 --- a/entity-framework/core/querying/complex-query-operators.md +++ b/entity-framework/core/querying/complex-query-operators.md @@ -141,7 +141,7 @@ ORDER BY [b].[Price] In this case, the GroupBy operator doesn't translate directly to a `GROUP BY` clause in the SQL, but instead, EF Core creates the groupings after the results are returned from the server. -## Left Join +## Left join While Left Join isn't a LINQ operator, relational databases have the concept of a Left Join which is frequently used in queries. A particular pattern in LINQ queries gives the same result as a `LEFT JOIN` on the server. EF Core identifies such patterns and generates the equivalent `LEFT JOIN` on the server side. The pattern involves creating a GroupJoin between both the data sources and then flattening out the grouping by using the SelectMany operator with DefaultIfEmpty on the grouping source to match null when the inner doesn't have a related element. The following example shows what that pattern looks like and what it generates. diff --git a/entity-framework/core/querying/sql-queries.md b/entity-framework/core/querying/sql-queries.md index c30f503e5f..a44aea05fe 100644 --- a/entity-framework/core/querying/sql-queries.md +++ b/entity-framework/core/querying/sql-queries.md @@ -162,7 +162,7 @@ Composing with LINQ requires your SQL query to be composable, since EF Core will SQL Server doesn't allow composing over stored procedure calls, so any attempt to apply additional query operators to such a call will result in invalid SQL. Use or right after or to make sure that EF Core doesn't try to compose over a stored procedure. -## Change Tracking +## Change tracking Queries that use or follow the exact same change tracking rules as any other LINQ query in EF Core. For example, if the query projects entity types, the results are tracked by default. diff --git a/entity-framework/core/saving/basic.md b/entity-framework/core/saving/basic.md index ec972e066d..972ecbb9f8 100644 --- a/entity-framework/core/saving/basic.md +++ b/entity-framework/core/saving/basic.md @@ -37,7 +37,7 @@ Use the Date: Mon, 15 Jun 2026 09:47:31 +0200 Subject: [PATCH 24/36] Fix formatting in EF Core providers index table (#5386) --- entity-framework/core/providers/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entity-framework/core/providers/index.md b/entity-framework/core/providers/index.md index 68299f7b0b..12a31b2f10 100644 --- a/entity-framework/core/providers/index.md +++ b/entity-framework/core/providers/index.md @@ -18,8 +18,8 @@ Entity Framework Core can access many different databases through plug-in librar > [!IMPORTANT] > EF Core providers typically do not work across major versions. For example, a provider released for EF Core 8 will not work with EF Core 9. -| NuGet Package | Supported database engines | Maintainer / Vendor | Notes / Requirements | For EF Core | Useful links | -|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| NuGet Package | Supported database engines | Maintainer / Vendor | Notes / Requirements | For EF Core | Useful links | +|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Microsoft.EntityFrameworkCore.SqlServer](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer) | Azure SQL, SQL Server 2012 onwards, Azure Synapse Analytics | [EF Core Project](https://github.com/dotnet/efcore/) (Microsoft) | | 8, 9, 10 | [docs](xref:core/providers/sql-server/index) | | [Microsoft.EntityFrameworkCore.Sqlite](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite) | SQLite 3.46.1 onwards | [EF Core Project](https://github.com/dotnet/efcore/) (Microsoft) | | 8, 9, 10 | [docs](xref:core/providers/sqlite/index) | | [Microsoft.EntityFrameworkCore.InMemory](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.InMemory) | EF Core in-memory database | [EF Core Project](https://github.com/dotnet/efcore/) (Microsoft) | [Limitations](xref:core/testing/testing-without-the-database#inmemory-provider) | 8, 9, 10 | [docs](xref:core/providers/in-memory/index) | @@ -27,7 +27,7 @@ Entity Framework Core can access many different databases through plug-in librar | [Npgsql.EntityFrameworkCore.PostgreSQL](https://www.nuget.org/packages/Npgsql.EntityFrameworkCore.PostgreSQL) | PostgreSQL | [Npgsql Development Team](https://github.com/npgsql) | | 8, 9 | [docs](https://www.npgsql.org/efcore/index.html) | | [Pomelo.EntityFrameworkCore.MySql](https://www.nuget.org/packages/Pomelo.EntityFrameworkCore.MySql) | MySQL, MariaDB | [Pomelo Foundation Project](https://github.com/PomeloFoundation) | | 8, 9 | [readme](https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/blob/master/README.md) | | [MySql.EntityFrameworkCore](https://www.nuget.org/packages/MySql.EntityFrameworkCore) | MySQL | [MySQL project](https://dev.mysql.com) (Oracle) | | 8, 9 | [docs](https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core.html) | -| [Oracle.EntityFrameworkCore](https://www.nuget.org/packages/Oracle.EntityFrameworkCore/) | Oracle DB 19c onwards | [Oracle](https://www.oracle.com/technetwork/topics/dotnet/) | | 8, 9, 10 | [docs](https://docs.oracle.com/en/database/oracle/oracle-database/26/odpnt/ODPEFCore.html) | +| [Oracle.EntityFrameworkCore](https://www.nuget.org/packages/Oracle.EntityFrameworkCore/) | Oracle DB 19c onwards | [Oracle](https://www.oracle.com/technetwork/topics/dotnet/) | | 8, 9, 10 | [docs](https://docs.oracle.com/en/database/oracle/oracle-database/26/odpnt/ODPEFCore.html) | | [MongoDB.EntityFrameworkCore](https://www.nuget.org/packages/MongoDB.EntityFrameworkCore/) | MongoDB | [MongoDB](https://www.mongodb.com/) | | 8 | [docs](https://www.mongodb.com/docs/entity-framework/current/) | | [Couchbase.EntityFrameworkCore](https://www.nuget.org/packages/Couchbase.EntityFrameworkCore) | Couchbase | [Couchbase](https://github.com/couchbaselabs/couchbase-efcore-provider) | | 8, 9 | [docs](https://docs.couchbase.com/efcore-provider/current/start-using-efcore-provider.html) | | [Devart.Data.MySql.EFCore](https://www.nuget.org/packages/Devart.Data.MySql.EFCore/) | MySQL 5 onwards | [DevArt](https://www.devart.com/dotconnect/mysql/) | Paid | 8, 9 | [docs](https://docs.devart.com/dotconnect/mysql/GettingStarted.html) | @@ -64,7 +64,7 @@ Entity Framework Core can access many different databases through plug-in librar | [EFCore.Snowflake](https://www.nuget.org/packages/EFCore.Snowflake/) | Snowflake | [Krzysztof Sielaff](https://github.com/Sielnix) | | 8 | [readme](https://github.com/Sielnix/EFCore.Snowflake/blob/main/README.md) | | [EFCore.Kusto](https://www.nuget.org/packages/EFCore.Kusto/) | Azure Data Explorer (Kusto) | [Anas Ismail Khan](https://github.com/anasik) | | 8 | [readme](https://github.com/anasik/EFCore.Kusto/blob/main/README.md) | | [EntityFrameworkCore.Ydb](https://www.nuget.org/packages/EntityFrameworkCore.Ydb) | YDB | [YDB Team](https://github.com/ydb-platform/) | | 9, 10 | [website](https://ydb.tech/docs/en/integrations/orm/entity-framework?version=main) | -| [DuckDB.EFCore](https://www.nuget.org/packages/DuckDB.EFCore) | DuckDB | [Denis Ivanov](https://github.com/denis-ivanov) | | 10 | [readme](https://github.com/denis-ivanov/DuckDB.EFCore/blob/master/README.md) | +| [DuckDB.EFCore](https://www.nuget.org/packages/DuckDB.EFCore) | DuckDB | [Denis Ivanov](https://github.com/denis-ivanov) | | 10 | [readme](https://github.com/denis-ivanov/DuckDB.EFCore/blob/master/README.md) | ## Adding a database provider to your application From 81f4e4e591b0fc2f49244e4260daa9fc4679ab91 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 08:31:22 -0700 Subject: [PATCH 25/36] Set author to SamMonoRT across documentation front matter and remove ms.author fields (#5389) --- entity-framework/core/get-started/overview/first-app.md | 2 +- entity-framework/core/get-started/wpf.md | 3 +-- .../core/includes/managed-identities-test-non-production.md | 3 +-- entity-framework/core/logging-events-diagnostics/metrics.md | 2 +- entity-framework/core/miscellaneous/async.md | 2 +- .../core/miscellaneous/collations-and-case-sensitivity.md | 2 +- entity-framework/core/miscellaneous/multitenancy.md | 3 +-- .../core/miscellaneous/nullable-reference-types.md | 2 +- entity-framework/core/modeling/entity-properties.md | 2 +- entity-framework/core/modeling/indexes.md | 2 +- entity-framework/core/modeling/sequences.md | 2 +- .../core/performance/advanced-performance-topics.md | 2 +- entity-framework/core/performance/efficient-querying.md | 2 +- entity-framework/core/performance/efficient-updating.md | 2 +- entity-framework/core/performance/index.md | 2 +- entity-framework/core/performance/modeling-for-performance.md | 2 +- .../core/performance/nativeaot-and-precompiled-queries.md | 2 +- entity-framework/core/performance/performance-diagnosis.md | 2 +- entity-framework/core/providers/cosmos/full-text-search.md | 2 +- entity-framework/core/providers/cosmos/modeling.md | 2 +- .../core/providers/cosmos/planetary-docs-sample.md | 3 +-- entity-framework/core/providers/cosmos/querying.md | 2 +- entity-framework/core/providers/cosmos/saving.md | 2 +- entity-framework/core/providers/cosmos/vector-search.md | 2 +- entity-framework/core/providers/sql-server/columns.md | 2 +- entity-framework/core/providers/sql-server/full-text-search.md | 2 +- entity-framework/core/providers/sql-server/functions.md | 2 +- entity-framework/core/providers/sql-server/indexes.md | 2 +- entity-framework/core/providers/sql-server/misc.md | 2 +- entity-framework/core/providers/sql-server/value-generation.md | 2 +- entity-framework/core/providers/sql-server/vector-search.md | 2 +- entity-framework/core/providers/sqlite/misc.md | 2 +- entity-framework/core/querying/client-eval.md | 2 +- entity-framework/core/querying/complex-query-operators.md | 2 +- entity-framework/core/querying/database-functions.md | 2 +- entity-framework/core/querying/filters.md | 2 +- entity-framework/core/querying/index.md | 2 +- entity-framework/core/querying/null-comparisons.md | 2 +- entity-framework/core/querying/pagination.md | 2 +- entity-framework/core/querying/related-data/eager.md | 2 +- entity-framework/core/querying/related-data/explicit.md | 2 +- entity-framework/core/querying/related-data/index.md | 2 +- entity-framework/core/querying/related-data/lazy.md | 2 +- entity-framework/core/querying/related-data/serialization.md | 2 +- entity-framework/core/querying/single-split-queries.md | 2 +- entity-framework/core/querying/sql-queries.md | 2 +- entity-framework/core/querying/tags.md | 2 +- entity-framework/core/querying/tracking.md | 2 +- .../core/querying/user-defined-function-mapping.md | 2 +- entity-framework/core/saving/execute-insert-update-delete.md | 2 +- entity-framework/core/saving/transactions.md | 2 +- entity-framework/core/testing/choosing-a-testing-strategy.md | 2 +- entity-framework/core/testing/index.md | 2 +- entity-framework/core/testing/testing-with-the-database.md | 2 +- entity-framework/core/testing/testing-without-the-database.md | 2 +- .../core/what-is-new/ef-core-10.0/breaking-changes.md | 2 +- entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md | 2 +- .../core/what-is-new/ef-core-11.0/breaking-changes.md | 2 +- .../core/what-is-new/ef-core-11.0/provider-facing-changes.md | 2 +- entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md | 2 +- entity-framework/core/what-is-new/ef-core-3.0.md | 2 +- entity-framework/efcore-and-ef6/porting/index.md | 2 +- entity-framework/efcore-and-ef6/porting/port-database.md | 2 +- entity-framework/efcore-and-ef6/porting/port-detailed-cases.md | 2 +- entity-framework/efcore-and-ef6/porting/port-hybrid.md | 2 +- 65 files changed, 65 insertions(+), 69 deletions(-) diff --git a/entity-framework/core/get-started/overview/first-app.md b/entity-framework/core/get-started/overview/first-app.md index e68a22c606..ecb2e3113d 100644 --- a/entity-framework/core/get-started/overview/first-app.md +++ b/entity-framework/core/get-started/overview/first-app.md @@ -1,7 +1,7 @@ --- title: Getting Started - EF Core description: Getting started tutorial for Entity Framework Core -author: rick-anderson +author: SamMonoRT ms.date: 09/17/2019 uid: core/get-started/overview/first-app --- diff --git a/entity-framework/core/get-started/wpf.md b/entity-framework/core/get-started/wpf.md index cd25e2b6ce..f51392da72 100644 --- a/entity-framework/core/get-started/wpf.md +++ b/entity-framework/core/get-started/wpf.md @@ -1,8 +1,7 @@ --- title: Get Started with WPF - EF Core description: Getting started tutorial for using WPF with Entity Framework Core -author: jeremylikness -ms.author: jeliknes +author: SamMonoRT ms.date: 07/24/2020 uid: core/get-started/wpf --- diff --git a/entity-framework/core/includes/managed-identities-test-non-production.md b/entity-framework/core/includes/managed-identities-test-non-production.md index dedfb45f35..f317bad9b3 100644 --- a/entity-framework/core/includes/managed-identities-test-non-production.md +++ b/entity-framework/core/includes/managed-identities-test-non-production.md @@ -1,7 +1,6 @@ --- description: A local database that doesn't require the user to be authenticated -author: rick-anderson -ms.author: wpickett +author: SamMonoRT ms.date: 10/23/2024 ms.topic: include title: an include file diff --git a/entity-framework/core/logging-events-diagnostics/metrics.md b/entity-framework/core/logging-events-diagnostics/metrics.md index 4434dfede3..9a5a1aac48 100644 --- a/entity-framework/core/logging-events-diagnostics/metrics.md +++ b/entity-framework/core/logging-events-diagnostics/metrics.md @@ -1,7 +1,7 @@ --- title: Metrics - EF Core description: Tracking EF Core performance and diagnosing anomalies with .NET metrics -author: cincuranet +author: SamMonoRT ms.date: 06/11/2024 uid: core/logging-events-diagnostics/metrics --- diff --git a/entity-framework/core/miscellaneous/async.md b/entity-framework/core/miscellaneous/async.md index 7360e38ec8..62b7c0fc48 100644 --- a/entity-framework/core/miscellaneous/async.md +++ b/entity-framework/core/miscellaneous/async.md @@ -1,7 +1,7 @@ --- title: Asynchronous Programming - EF Core description: Querying and saving data asynchronously with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 10/1/2021 uid: core/miscellaneous/async --- diff --git a/entity-framework/core/miscellaneous/collations-and-case-sensitivity.md b/entity-framework/core/miscellaneous/collations-and-case-sensitivity.md index 821d2d39b2..130cf4d18e 100644 --- a/entity-framework/core/miscellaneous/collations-and-case-sensitivity.md +++ b/entity-framework/core/miscellaneous/collations-and-case-sensitivity.md @@ -1,7 +1,7 @@ --- title: Collations and case sensitivity - EF Core description: Configuring collations and case-sensitivity in the database and on queries with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 04/27/2020 uid: core/miscellaneous/collations-and-case-sensitivity --- diff --git a/entity-framework/core/miscellaneous/multitenancy.md b/entity-framework/core/miscellaneous/multitenancy.md index 44e0fdbca8..0c70b70a6f 100644 --- a/entity-framework/core/miscellaneous/multitenancy.md +++ b/entity-framework/core/miscellaneous/multitenancy.md @@ -1,8 +1,7 @@ --- title: Multi-tenancy - EF Core description: Learn several ways to implement multi-tenant databases using Entity Framework Core. -author: jeremylikness -ms.author: jeliknes +author: SamMonoRT ms.date: 03/01/2022 uid: core/miscellaneous/multitenancy --- diff --git a/entity-framework/core/miscellaneous/nullable-reference-types.md b/entity-framework/core/miscellaneous/nullable-reference-types.md index 5c000b5f22..0b0c6ce521 100644 --- a/entity-framework/core/miscellaneous/nullable-reference-types.md +++ b/entity-framework/core/miscellaneous/nullable-reference-types.md @@ -1,7 +1,7 @@ --- title: Working with nullable reference types - EF Core description: Working with C# nullable reference types when using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 09/09/2019 uid: core/miscellaneous/nullable-reference-types --- diff --git a/entity-framework/core/modeling/entity-properties.md b/entity-framework/core/modeling/entity-properties.md index 9db50d1c8f..15e5b02434 100644 --- a/entity-framework/core/modeling/entity-properties.md +++ b/entity-framework/core/modeling/entity-properties.md @@ -1,7 +1,7 @@ --- title: Entity Properties - EF Core description: How to configure and map entity properties using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 10/12/2021 uid: core/modeling/entity-properties --- diff --git a/entity-framework/core/modeling/indexes.md b/entity-framework/core/modeling/indexes.md index 003ca0c9cb..0760817b0d 100644 --- a/entity-framework/core/modeling/indexes.md +++ b/entity-framework/core/modeling/indexes.md @@ -1,7 +1,7 @@ --- title: Indexes - EF Core description: Configuring indexes in an Entity Framework Core model -author: roji +author: SamMonoRT ms.date: 10/1/2021 uid: core/modeling/indexes --- diff --git a/entity-framework/core/modeling/sequences.md b/entity-framework/core/modeling/sequences.md index b4a5c193eb..d9a628aad8 100644 --- a/entity-framework/core/modeling/sequences.md +++ b/entity-framework/core/modeling/sequences.md @@ -1,7 +1,7 @@ --- title: Sequences - EF Core description: Configuring sequences in an Entity Framework Core model -author: roji +author: SamMonoRT ms.date: 12/18/2019 uid: core/modeling/sequences --- diff --git a/entity-framework/core/performance/advanced-performance-topics.md b/entity-framework/core/performance/advanced-performance-topics.md index 6968e94cfa..596f0bb385 100644 --- a/entity-framework/core/performance/advanced-performance-topics.md +++ b/entity-framework/core/performance/advanced-performance-topics.md @@ -1,7 +1,7 @@ --- title: Advanced Performance Topics - EF Core description: Advanced performance topics for Entity Framework Core -author: roji +author: SamMonoRT ms.date: 11/21/2025 uid: core/performance/advanced-performance-topics ms.custom: sfi-ropc-nochange diff --git a/entity-framework/core/performance/efficient-querying.md b/entity-framework/core/performance/efficient-querying.md index b2af305d6b..f66fff559f 100644 --- a/entity-framework/core/performance/efficient-querying.md +++ b/entity-framework/core/performance/efficient-querying.md @@ -1,7 +1,7 @@ --- title: Efficient Querying - EF Core description: Performance guide for efficient querying using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 10/1/2021 uid: core/performance/efficient-querying --- diff --git a/entity-framework/core/performance/efficient-updating.md b/entity-framework/core/performance/efficient-updating.md index 7a2a6c4f81..d2f9c81d0c 100644 --- a/entity-framework/core/performance/efficient-updating.md +++ b/entity-framework/core/performance/efficient-updating.md @@ -1,7 +1,7 @@ --- title: Efficient Updating - EF Core description: Performance guide for efficient updating using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 12/1/2020 uid: core/performance/efficient-updating --- diff --git a/entity-framework/core/performance/index.md b/entity-framework/core/performance/index.md index 5cdb405e1d..95f4b4245e 100644 --- a/entity-framework/core/performance/index.md +++ b/entity-framework/core/performance/index.md @@ -1,7 +1,7 @@ --- title: Introduction to Performance - EF Core description: Performance guide for efficiently using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 12/1/2020 uid: core/miscellaneous/performance/index --- diff --git a/entity-framework/core/performance/modeling-for-performance.md b/entity-framework/core/performance/modeling-for-performance.md index 5c008f6232..142c55d78b 100644 --- a/entity-framework/core/performance/modeling-for-performance.md +++ b/entity-framework/core/performance/modeling-for-performance.md @@ -1,7 +1,7 @@ --- title: Modeling for Performance - EF Core description: Modeling efficiently when using Entity Framework Core -author: roji +author: SamMonoRT ms.date: 10/10/2022 uid: core/performance/modeling-for-performance --- diff --git a/entity-framework/core/performance/nativeaot-and-precompiled-queries.md b/entity-framework/core/performance/nativeaot-and-precompiled-queries.md index 50e0394211..f767a4a421 100644 --- a/entity-framework/core/performance/nativeaot-and-precompiled-queries.md +++ b/entity-framework/core/performance/nativeaot-and-precompiled-queries.md @@ -1,7 +1,7 @@ --- title: NativeAOT Support and Precompiled Queries (Experimental) - EF Core description: Publishing NativeAOT Entity Framework Core applications and using precompiled queries -author: roji +author: SamMonoRT ms.date: 11/10/2024 uid: core/performance/nativeaot-and-precompiled-queries --- diff --git a/entity-framework/core/performance/performance-diagnosis.md b/entity-framework/core/performance/performance-diagnosis.md index 09492fac7b..87115a7336 100644 --- a/entity-framework/core/performance/performance-diagnosis.md +++ b/entity-framework/core/performance/performance-diagnosis.md @@ -1,7 +1,7 @@ --- title: Performance Diagnosis - EF Core description: Diagnosing Entity Framework Core performance and identifying bottlenecks -author: roji +author: SamMonoRT ms.date: 12/1/2020 uid: core/performance/performance-diagnosis --- diff --git a/entity-framework/core/providers/cosmos/full-text-search.md b/entity-framework/core/providers/cosmos/full-text-search.md index 0140b7d07f..27832d2366 100644 --- a/entity-framework/core/providers/cosmos/full-text-search.md +++ b/entity-framework/core/providers/cosmos/full-text-search.md @@ -1,7 +1,7 @@ --- title: Full-Text Search - Azure Cosmos DB Provider - EF Core description: Full-text search with the Azure Cosmos DB EF Core Provider -author: maumar +author: SamMonoRT ms.date: 04/19/2025 uid: core/providers/cosmos/full-text-search --- diff --git a/entity-framework/core/providers/cosmos/modeling.md b/entity-framework/core/providers/cosmos/modeling.md index c3c5262536..50ec61e101 100644 --- a/entity-framework/core/providers/cosmos/modeling.md +++ b/entity-framework/core/providers/cosmos/modeling.md @@ -1,7 +1,7 @@ --- title: Modeling - Azure Cosmos DB Provider - EF Core description: Configuring the model with the Azure Cosmos DB EF Core Provider -author: roji +author: SamMonoRT ms.date: 09/26/2024 uid: core/providers/cosmos/modeling --- diff --git a/entity-framework/core/providers/cosmos/planetary-docs-sample.md b/entity-framework/core/providers/cosmos/planetary-docs-sample.md index 2225fe864c..ca52d26622 100644 --- a/entity-framework/core/providers/cosmos/planetary-docs-sample.md +++ b/entity-framework/core/providers/cosmos/planetary-docs-sample.md @@ -1,8 +1,7 @@ --- title: Azure Cosmos DB Provider - Planetary Docs sample - EF Core description: An end-to-end sample to demonstrate create, read and update capabilities in the EF Core Azure Cosmos DB provider. -author: JeremyLikness -ms.author: jeliknes +author: SamMonoRT ms.date: 01/27/2022 uid: core/providers/cosmos/planetary-docs-sample --- diff --git a/entity-framework/core/providers/cosmos/querying.md b/entity-framework/core/providers/cosmos/querying.md index 582a085599..ccf7b92eee 100644 --- a/entity-framework/core/providers/cosmos/querying.md +++ b/entity-framework/core/providers/cosmos/querying.md @@ -1,7 +1,7 @@ --- title: Querying - Azure Cosmos DB Provider - EF Core description: Querying with the Azure Cosmos DB EF Core Provider -author: roji +author: SamMonoRT ms.date: 09/19/2024 uid: core/providers/cosmos/querying --- diff --git a/entity-framework/core/providers/cosmos/saving.md b/entity-framework/core/providers/cosmos/saving.md index b2f1da1a7c..7a4a476181 100644 --- a/entity-framework/core/providers/cosmos/saving.md +++ b/entity-framework/core/providers/cosmos/saving.md @@ -1,7 +1,7 @@ --- title: Saving Data - Azure Cosmos DB Provider - EF Core description: Saving data with the Azure Cosmos DB EF Core Provider -author: roji +author: SamMonoRT ms.date: 02/02/2026 uid: core/providers/cosmos/saving --- diff --git a/entity-framework/core/providers/cosmos/vector-search.md b/entity-framework/core/providers/cosmos/vector-search.md index 8fdc7924ef..ee5b2a466f 100644 --- a/entity-framework/core/providers/cosmos/vector-search.md +++ b/entity-framework/core/providers/cosmos/vector-search.md @@ -1,7 +1,7 @@ --- title: Vector Search - Azure Cosmos DB Provider - EF Core description: Vector search with the Azure Cosmos DB EF Core Provider -author: roji +author: SamMonoRT ms.date: 09/20/2024 uid: core/providers/cosmos/vector-search --- diff --git a/entity-framework/core/providers/sql-server/columns.md b/entity-framework/core/providers/sql-server/columns.md index b04949855c..7b08fdbebb 100644 --- a/entity-framework/core/providers/sql-server/columns.md +++ b/entity-framework/core/providers/sql-server/columns.md @@ -1,7 +1,7 @@ --- title: Microsoft SQL Server Database Provider - Columns - EF Core description: Column features specific to the Entity Framework Core SQL Server provider -author: roji +author: SamMonoRT ms.date: 10/12/2021 uid: core/providers/sql-server/columns --- diff --git a/entity-framework/core/providers/sql-server/full-text-search.md b/entity-framework/core/providers/sql-server/full-text-search.md index abdba6496a..bf35f7700d 100644 --- a/entity-framework/core/providers/sql-server/full-text-search.md +++ b/entity-framework/core/providers/sql-server/full-text-search.md @@ -1,7 +1,7 @@ --- title: Microsoft SQL Server Database Provider - Full-Text Search - EF Core description: Using full-text search with the Entity Framework Core Microsoft SQL Server database provider -author: roji +author: SamMonoRT ms.date: 02/05/2026 uid: core/providers/sql-server/full-text-search --- diff --git a/entity-framework/core/providers/sql-server/functions.md b/entity-framework/core/providers/sql-server/functions.md index 42ea32ef66..a39bc6d151 100644 --- a/entity-framework/core/providers/sql-server/functions.md +++ b/entity-framework/core/providers/sql-server/functions.md @@ -1,7 +1,7 @@ --- title: Function Mappings - Microsoft SQL Server Database Provider - EF Core description: Function Mappings of the Microsoft SQL Server database provider -author: roji +author: SamMonoRT ms.date: 4/14/2026 uid: core/providers/sql-server/functions --- diff --git a/entity-framework/core/providers/sql-server/indexes.md b/entity-framework/core/providers/sql-server/indexes.md index 326de935f1..4efd90ab63 100644 --- a/entity-framework/core/providers/sql-server/indexes.md +++ b/entity-framework/core/providers/sql-server/indexes.md @@ -1,7 +1,7 @@ --- title: Microsoft SQL Server Database Provider - Indexes - EF Core description: Index features specific to the Entity Framework Core SQL Server provider -author: roji +author: SamMonoRT ms.date: 9/1/2020 uid: core/providers/sql-server/indexes --- diff --git a/entity-framework/core/providers/sql-server/misc.md b/entity-framework/core/providers/sql-server/misc.md index 022c787d1c..ceec3f997f 100644 --- a/entity-framework/core/providers/sql-server/misc.md +++ b/entity-framework/core/providers/sql-server/misc.md @@ -1,7 +1,7 @@ --- title: Miscellaneous - Microsoft SQL Server Database Provider - EF Core description: Miscellaneous for the Microsoft SQL Server database provider -author: roji +author: SamMonoRT ms.date: 09/20/2022 uid: core/providers/sql-server/misc --- diff --git a/entity-framework/core/providers/sql-server/value-generation.md b/entity-framework/core/providers/sql-server/value-generation.md index e564e736d0..fda5064f6e 100644 --- a/entity-framework/core/providers/sql-server/value-generation.md +++ b/entity-framework/core/providers/sql-server/value-generation.md @@ -1,7 +1,7 @@ --- title: Microsoft SQL Server Database Provider - Value Generation - EF Core description: Value Generation Patterns Specific to the SQL Server Entity Framework Core Database Provider -author: roji +author: SamMonoRT ms.date: 11/15/2021 uid: core/providers/sql-server/value-generation --- diff --git a/entity-framework/core/providers/sql-server/vector-search.md b/entity-framework/core/providers/sql-server/vector-search.md index 48acc81946..6a47ca7b05 100644 --- a/entity-framework/core/providers/sql-server/vector-search.md +++ b/entity-framework/core/providers/sql-server/vector-search.md @@ -1,7 +1,7 @@ --- title: Microsoft SQL Server Database Provider - Vector Search - EF Core description: Using vectors and embeddings to perform similarity search with the Entity Framework Core Microsoft SQL Server database provider -author: roji +author: SamMonoRT ms.date: 06/09/2026 uid: core/providers/sql-server/vector-search --- diff --git a/entity-framework/core/providers/sqlite/misc.md b/entity-framework/core/providers/sqlite/misc.md index dab10b9e89..69c704ec3d 100644 --- a/entity-framework/core/providers/sqlite/misc.md +++ b/entity-framework/core/providers/sqlite/misc.md @@ -1,7 +1,7 @@ --- title: Miscellaneous - SQLite Database Provider - EF Core description: Miscellaneous information for the SQLite database provider -author: roji +author: SamMonoRT ms.date: 11/27/2025 uid: core/providers/sqlite/misc --- diff --git a/entity-framework/core/querying/client-eval.md b/entity-framework/core/querying/client-eval.md index fd14e8b5ad..940091d6ce 100644 --- a/entity-framework/core/querying/client-eval.md +++ b/entity-framework/core/querying/client-eval.md @@ -1,7 +1,7 @@ --- title: Client vs. Server Evaluation - EF Core description: Client and server evaluation of queries with Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 11/09/2020 uid: core/querying/client-eval --- diff --git a/entity-framework/core/querying/complex-query-operators.md b/entity-framework/core/querying/complex-query-operators.md index ecfb3a6377..03f40d829e 100644 --- a/entity-framework/core/querying/complex-query-operators.md +++ b/entity-framework/core/querying/complex-query-operators.md @@ -1,7 +1,7 @@ --- title: Complex Query Operators - EF Core description: In-depth information on the more complex LINQ query operators when using Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 10/03/2019 uid: core/querying/complex-query-operators --- diff --git a/entity-framework/core/querying/database-functions.md b/entity-framework/core/querying/database-functions.md index bf8649c223..88ff6070f2 100644 --- a/entity-framework/core/querying/database-functions.md +++ b/entity-framework/core/querying/database-functions.md @@ -1,7 +1,7 @@ --- title: Database Functions - EF Core description: Information on database functions supported in EF Core query translation -author: smitpatel +author: SamMonoRT ms.date: 11/10/2020 uid: core/querying/database-functions --- diff --git a/entity-framework/core/querying/filters.md b/entity-framework/core/querying/filters.md index 75ddc4d792..ec401630e5 100644 --- a/entity-framework/core/querying/filters.md +++ b/entity-framework/core/querying/filters.md @@ -1,7 +1,7 @@ --- title: Global Query Filters - EF Core description: Using global query filters to filter results with Entity Framework Core -author: maumar +author: SamMonoRT ms.date: 11/03/2017 uid: core/querying/filters --- diff --git a/entity-framework/core/querying/index.md b/entity-framework/core/querying/index.md index 5fb484121a..a2247cf2d5 100644 --- a/entity-framework/core/querying/index.md +++ b/entity-framework/core/querying/index.md @@ -1,7 +1,7 @@ --- title: Querying Data - EF Core description: Overview of information on querying in Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 10/03/2019 uid: core/querying/index --- diff --git a/entity-framework/core/querying/null-comparisons.md b/entity-framework/core/querying/null-comparisons.md index 8e343bf30f..3c59550689 100644 --- a/entity-framework/core/querying/null-comparisons.md +++ b/entity-framework/core/querying/null-comparisons.md @@ -1,7 +1,7 @@ --- title: Comparisons with null values in queries description: Information on how Entity Framework Core handles null comparisons in queries -author: maumar +author: SamMonoRT ms.date: 11/11/2020 uid: core/querying/null-comparisons --- diff --git a/entity-framework/core/querying/pagination.md b/entity-framework/core/querying/pagination.md index eec9c64c29..9fc86a52a8 100644 --- a/entity-framework/core/querying/pagination.md +++ b/entity-framework/core/querying/pagination.md @@ -1,7 +1,7 @@ --- title: Pagination - EF Core description: Writing paginating queries in Entity Framework Core -author: roji +author: SamMonoRT ms.date: 12/19/2021 uid: core/querying/pagination --- diff --git a/entity-framework/core/querying/related-data/eager.md b/entity-framework/core/querying/related-data/eager.md index 49886b9a89..6754d62fdf 100644 --- a/entity-framework/core/querying/related-data/eager.md +++ b/entity-framework/core/querying/related-data/eager.md @@ -1,7 +1,7 @@ --- title: Eager Loading of Related Data - EF Core description: Eager loading of related data with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 11/11/2021 uid: core/querying/related-data/eager --- diff --git a/entity-framework/core/querying/related-data/explicit.md b/entity-framework/core/querying/related-data/explicit.md index 3a3e25caac..cee03b4dab 100644 --- a/entity-framework/core/querying/related-data/explicit.md +++ b/entity-framework/core/querying/related-data/explicit.md @@ -1,7 +1,7 @@ --- title: Explicit Loading of Related Data - EF Core description: Explicit loading of related data with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 9/8/2020 uid: core/querying/related-data/explicit --- diff --git a/entity-framework/core/querying/related-data/index.md b/entity-framework/core/querying/related-data/index.md index 507a72cc3f..2ebbf13bfb 100644 --- a/entity-framework/core/querying/related-data/index.md +++ b/entity-framework/core/querying/related-data/index.md @@ -1,7 +1,7 @@ --- title: Loading Related Data - EF Core description: Different strategies for loading related data with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 9/11/2020 uid: core/querying/related-data --- diff --git a/entity-framework/core/querying/related-data/lazy.md b/entity-framework/core/querying/related-data/lazy.md index 5c3e8ac2f8..9ab98fd503 100644 --- a/entity-framework/core/querying/related-data/lazy.md +++ b/entity-framework/core/querying/related-data/lazy.md @@ -1,7 +1,7 @@ --- title: Lazy Loading of Related Data - EF Core description: Lazy loading of related data with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 9/8/2020 uid: core/querying/related-data/lazy ms.custom: sfi-ropc-nochange diff --git a/entity-framework/core/querying/related-data/serialization.md b/entity-framework/core/querying/related-data/serialization.md index 0ca8641729..71db6dec08 100644 --- a/entity-framework/core/querying/related-data/serialization.md +++ b/entity-framework/core/querying/related-data/serialization.md @@ -1,7 +1,7 @@ --- title: Related Data and Serialization - EF Core description: Information about how cycles in related data with Entity Framework Core can affect serialization frameworks -author: roji +author: SamMonoRT ms.date: 9/8/2020 uid: core/querying/related-data/serialization --- diff --git a/entity-framework/core/querying/single-split-queries.md b/entity-framework/core/querying/single-split-queries.md index 99ca263204..37f98e7da9 100644 --- a/entity-framework/core/querying/single-split-queries.md +++ b/entity-framework/core/querying/single-split-queries.md @@ -1,7 +1,7 @@ --- title: Single vs. Split Queries - EF Core description: Translating LINQ queries into single and split SQL queries with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 1/9/2023 uid: core/querying/single-split-queries --- diff --git a/entity-framework/core/querying/sql-queries.md b/entity-framework/core/querying/sql-queries.md index a44aea05fe..422b69cf66 100644 --- a/entity-framework/core/querying/sql-queries.md +++ b/entity-framework/core/querying/sql-queries.md @@ -1,7 +1,7 @@ --- title: SQL Queries - EF Core description: Using SQL queries in Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 09/19/2022 uid: core/querying/sql-queries --- diff --git a/entity-framework/core/querying/tags.md b/entity-framework/core/querying/tags.md index f8b5131e3b..b1df7e6dd1 100644 --- a/entity-framework/core/querying/tags.md +++ b/entity-framework/core/querying/tags.md @@ -1,7 +1,7 @@ --- title: Query Tags - EF Core description: Using query tags to help identify specific queries in log messages emitted by Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 11/14/2018 uid: core/querying/tags --- diff --git a/entity-framework/core/querying/tracking.md b/entity-framework/core/querying/tracking.md index 7d11841cae..8c217892ad 100644 --- a/entity-framework/core/querying/tracking.md +++ b/entity-framework/core/querying/tracking.md @@ -1,7 +1,7 @@ --- title: Tracking vs. No-Tracking Queries - EF Core description: Information on tracking and no-tracking queries in Entity Framework Core -author: smitpatel +author: SamMonoRT ms.date: 3/15/2023 uid: core/querying/tracking --- diff --git a/entity-framework/core/querying/user-defined-function-mapping.md b/entity-framework/core/querying/user-defined-function-mapping.md index 47747a777d..e76dbd7ef6 100644 --- a/entity-framework/core/querying/user-defined-function-mapping.md +++ b/entity-framework/core/querying/user-defined-function-mapping.md @@ -1,7 +1,7 @@ --- title: User-defined function mapping - EF Core description: Mapping user-defined functions to database functions -author: maumar +author: SamMonoRT ms.date: 11/23/2020 uid: core/querying/user-defined-function-mapping --- diff --git a/entity-framework/core/saving/execute-insert-update-delete.md b/entity-framework/core/saving/execute-insert-update-delete.md index 1e4760b84e..0bb9c4d8c3 100644 --- a/entity-framework/core/saving/execute-insert-update-delete.md +++ b/entity-framework/core/saving/execute-insert-update-delete.md @@ -1,7 +1,7 @@ --- title: ExecuteUpdate and ExecuteDelete - EF Core description: Using ExecuteUpdate and ExecuteDelete to save changes with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 4/30/2023 uid: core/saving/execute-insert-update-delete --- diff --git a/entity-framework/core/saving/transactions.md b/entity-framework/core/saving/transactions.md index 6788e93d87..0ba4ef2dd9 100644 --- a/entity-framework/core/saving/transactions.md +++ b/entity-framework/core/saving/transactions.md @@ -1,7 +1,7 @@ --- title: Transactions - EF Core description: Managing transactions for atomicity when saving data with Entity Framework Core -author: roji +author: SamMonoRT ms.date: 9/26/2020 uid: core/saving/transactions --- diff --git a/entity-framework/core/testing/choosing-a-testing-strategy.md b/entity-framework/core/testing/choosing-a-testing-strategy.md index 371997f0e2..ad8cd466a9 100644 --- a/entity-framework/core/testing/choosing-a-testing-strategy.md +++ b/entity-framework/core/testing/choosing-a-testing-strategy.md @@ -1,7 +1,7 @@ --- title: Choosing a testing strategy - EF Core description: Different approaches to testing applications that use Entity Framework Core -author: roji +author: SamMonoRT ms.date: 11/07/2021 uid: core/testing/choosing-a-testing-strategy --- diff --git a/entity-framework/core/testing/index.md b/entity-framework/core/testing/index.md index f745459b15..b5d6e905b3 100644 --- a/entity-framework/core/testing/index.md +++ b/entity-framework/core/testing/index.md @@ -1,7 +1,7 @@ --- title: Overview of testing applications that use EF Core - EF Core description: Overview of testing applications that use Entity Framework Core -author: roji +author: SamMonoRT ms.date: 01/17/2021 uid: core/testing/index --- diff --git a/entity-framework/core/testing/testing-with-the-database.md b/entity-framework/core/testing/testing-with-the-database.md index fe33124490..2a563b996a 100644 --- a/entity-framework/core/testing/testing-with-the-database.md +++ b/entity-framework/core/testing/testing-with-the-database.md @@ -1,7 +1,7 @@ --- title: Testing against your Production Database System - EF Core description: Techniques for testing EF Core applications against your production database system -author: roji +author: SamMonoRT ms.date: 1/24/2022 uid: core/testing/testing-with-the-database --- diff --git a/entity-framework/core/testing/testing-without-the-database.md b/entity-framework/core/testing/testing-without-the-database.md index 311804028e..a67989e927 100644 --- a/entity-framework/core/testing/testing-without-the-database.md +++ b/entity-framework/core/testing/testing-without-the-database.md @@ -1,7 +1,7 @@ --- title: Testing without your Production Database System - EF Core description: Techniques for testing EF Core applications without involving your production database system -author: roji +author: SamMonoRT ms.date: 01/24/2022 uid: core/testing/testing-without-the-database --- diff --git a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md index 7bd3139c43..05d3745f9e 100644 --- a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md @@ -1,7 +1,7 @@ --- title: Breaking changes in EF Core 10 (EF10) - EF Core description: List of breaking changes introduced in Entity Framework Core 10 (EF10) -author: roji +author: SamMonoRT ms.date: 10/09/2025 uid: core/what-is-new/ef-core-10.0/breaking-changes --- diff --git a/entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md index f91b34e65d..46151cdc1d 100644 --- a/entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-10.0/whatsnew.md @@ -1,7 +1,7 @@ --- title: What's New in EF Core 10 description: Overview of new features in EF Core 10 -author: roji +author: SamMonoRT ms.date: 10/02/2025 uid: core/what-is-new/ef-core-10.0/whatsnew --- diff --git a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md index d2b096990e..25416828e0 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md @@ -1,7 +1,7 @@ --- title: Breaking changes in EF Core 11 (EF11) - EF Core description: List of breaking changes introduced in Entity Framework Core 11 (EF11) -author: roji +author: SamMonoRT ms.date: 03/27/2026 uid: core/what-is-new/ef-core-11.0/breaking-changes --- diff --git a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md index de4576876e..5f48f20243 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md @@ -1,7 +1,7 @@ --- title: Provider-facing changes in EF Core 11 (EF11) - EF Core description: List of provider-facing changes introduced in Entity Framework Core 11 (EF11) -author: roji +author: SamMonoRT ms.date: 04/08/2026 uid: core/what-is-new/ef-core-11.0/provider-facing-changes --- diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index c49620df6d..64f8cd36a5 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -1,7 +1,7 @@ --- title: What's New in EF Core 11 description: Overview of new features in EF Core 11 -author: roji +author: SamMonoRT ms.date: 04/22/2026 uid: core/what-is-new/ef-core-11.0/whatsnew --- diff --git a/entity-framework/core/what-is-new/ef-core-3.0.md b/entity-framework/core/what-is-new/ef-core-3.0.md index 64bf5531b2..a8a940f9a9 100644 --- a/entity-framework/core/what-is-new/ef-core-3.0.md +++ b/entity-framework/core/what-is-new/ef-core-3.0.md @@ -1,7 +1,7 @@ --- title: What is new in EF Core 3.0 - EF Core description: Changes and improvements in Entity Framework Core 3.0 -author: smitpatel +author: SamMonoRT ms.date: 11/09/2020 uid: core/what-is-new/ef-core-3.0 --- diff --git a/entity-framework/efcore-and-ef6/porting/index.md b/entity-framework/efcore-and-ef6/porting/index.md index 434766a0f9..62d1405b2d 100644 --- a/entity-framework/efcore-and-ef6/porting/index.md +++ b/entity-framework/efcore-and-ef6/porting/index.md @@ -1,7 +1,7 @@ --- title: Port from EF6 to EF Core - EF description: A detailed guide to port your EF6 apps to EF Core -author: jeremylikness +author: SamMonoRT ms.alias: jeliknes ms.date: 12/09/2021 uid: efcore-and-ef6/porting/index diff --git a/entity-framework/efcore-and-ef6/porting/port-database.md b/entity-framework/efcore-and-ef6/porting/port-database.md index 20eb1d3413..0caf8aec4e 100644 --- a/entity-framework/efcore-and-ef6/porting/port-database.md +++ b/entity-framework/efcore-and-ef6/porting/port-database.md @@ -1,7 +1,7 @@ --- title: Port from EF6 to EF Core - Database as Source of Truth description: How to port from EF6 to EF Core when you generate your model from the database. -author: jeremylikness +author: SamMonoRT ms.alias: jeliknes ms.date: 12/09/2021 uid: efcore-and-ef6/porting/port-database diff --git a/entity-framework/efcore-and-ef6/porting/port-detailed-cases.md b/entity-framework/efcore-and-ef6/porting/port-detailed-cases.md index 50a0a9aa22..c67244dac4 100644 --- a/entity-framework/efcore-and-ef6/porting/port-detailed-cases.md +++ b/entity-framework/efcore-and-ef6/porting/port-detailed-cases.md @@ -1,7 +1,7 @@ --- title: Port from EF6 to EF Core - Detailed Cases description: Guide to solutions, fixes, and workarounds for common issues that come up during the port from EF 6 to EF Core. -author: jeremylikness +author: SamMonoRT ms.alias: jeliknes ms.date: 12/09/2021 uid: efcore-and-ef6/porting/port-detailed-cases diff --git a/entity-framework/efcore-and-ef6/porting/port-hybrid.md b/entity-framework/efcore-and-ef6/porting/port-hybrid.md index 0152f45f70..704bf85af0 100644 --- a/entity-framework/efcore-and-ef6/porting/port-hybrid.md +++ b/entity-framework/efcore-and-ef6/porting/port-hybrid.md @@ -1,7 +1,7 @@ --- title: Port from EF6 to EF Core - Hybrid Approach description: How to port from EF6 to EF Core when you iterate your domain model and database separately and use mapping to connect the two. -author: jeremylikness +author: SamMonoRT ms.alias: jeliknes ms.date: 12/09/2021 uid: efcore-and-ef6/porting/port-hybrid From 3c35c122f6443767a5c4ef4a0e4bc44e4f040506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Say=C4=B1n?= Date: Thu, 25 Jun 2026 02:12:03 +0300 Subject: [PATCH 26/36] Add note about PendingModelChangesWarning behavior in EF Core 9 (#5390) --- entity-framework/core/managing-schemas/migrations/applying.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entity-framework/core/managing-schemas/migrations/applying.md b/entity-framework/core/managing-schemas/migrations/applying.md index 15db8f7460..d76afbd195 100644 --- a/entity-framework/core/managing-schemas/migrations/applying.md +++ b/entity-framework/core/managing-schemas/migrations/applying.md @@ -355,6 +355,9 @@ Migration locking applies when migrations are applied using any of the following [SQL scripts](#sql-scripts) are not affected by migration locking, since they are applied outside of EF Core. +> [!NOTE] +> Starting with EF Core 9, calling `Migrate()` or `MigrateAsync()` will throw an exception when the model has pending changes compared to the last migration (warning event ID `RelationalEventId.PendingModelChangesWarning`). To detect this condition before deployment, use the [`dotnet ef migrations has-pending-model-changes`](xref:core/managing-schemas/migrations/managing#checking-for-pending-model-changes) command in your CI/CD pipeline. The warning can be suppressed via `ConfigureWarnings` (ignoring `RelationalEventId.PendingModelChangesWarning`) if necessary, but this is generally not recommended in production scenarios. See the [breaking change note](xref:core/what-is-new/ef-core-9.0/breaking-changes#pending-model-changes) for more information. + > [!WARNING] > The locking mechanism varies significantly across database providers and can involve provider-specific issues. For example, the SQLite provider uses a lock table that can become [abandoned if the process terminates unexpectedly](xref:core/providers/sqlite/limitations#concurrent-migrations-protection). Always consult your provider's documentation for details. From 93a1a1fbf669596103ef2361e360f76df13994a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Thu, 25 Jun 2026 19:54:44 +0200 Subject: [PATCH 27/36] Fix link. (#5397) --- .../core/what-is-new/ef-core-11.0/breaking-changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md index 25416828e0..d47791ef7d 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md @@ -122,7 +122,7 @@ If your application uses composite keys whose values can contain the characters - **Existing data**: Documents previously stored in Cosmos DB have `id` values using the old escape sequences (e.g. `Post|1|^2F`). After upgrading to EF Core 11, EF will generate unescaped `id` values (e.g. `Post|1|/`) and will no longer find those existing documents. To continue accessing existing data without migration, opt back into the old behavior using the `AppContext` switch described above—however, be aware that the id-collision bug will still be present. -- **New data**: If you are creating a new application or database, avoid using these illegal characters in key values, as they are not valid in Cosmos DB resource `id` values. See the [Azure documentation](https://learn.microsoft.com/dotnet/api/microsoft.azure.documents.resource.id) for details. +- **New data**: If you are creating a new application or database, avoid using these illegal characters in key values, as they are not valid in Cosmos DB resource `id` values. See the [Azure documentation](xref:Microsoft.Azure.Documents.Resource.Id) for details. ## Low-impact changes From 98491a6f3b870fffe11a51f1dc8b416dcaeaff6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Fri, 26 Jun 2026 19:40:07 +0200 Subject: [PATCH 28/36] Add standup (#5400) --- .../core/learn-more/community-standups.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index c15b51e5fa..090af9a6c5 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -14,6 +14,7 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday | Date | Area | Title | |--------------|-----------------------|------------------------------------------------------------------------------------------| +| Jun 25, 2026 | Temporal tables | [Temporal tables and constraints in SQL Server and PostgreSQL 18](#Jun25_2026) | | May 21, 2026 | EF Core | [8 Real-World Query Anti-Patterns (and How to Fix Them)](#May21_2026) | | Apr 23, 2026 | Tools | [Lightweight Framework to Automate EF Components](#Apr23_2026) | | Mar 19, 2026 | DevArt | [How dotConnect + Entity Developer simplify your workflow](#Mar19_2026) | @@ -112,6 +113,17 @@ The .NET Data Community Standups are live-streamed monthly (roughly) on Thursday ## 2026 + + +### Jun 25: [Temporal tables and constraints in SQL Server and PostgreSQL 18](https://www.youtube.com/live/BcbhBFm1MuU?si=qczW0FmktU9xq3c3) + +In this session we'll take a deep look at temporal tables and constraints in database. The recently-released PostgreSQL 18 contains new temporal constraint functionality that superficially looks similar to SQL Server's temporal tables, but the two are in reality quite different. We'll dive into the details, compare the two and discuss two completely different concepts of what it means to store temporal data in databases. + +Featuring: + +- [Shay Rojansky](https://www.roji.org/) (Special guest) +- [Jiri Cincura](https://www.tabsoverspaces.com/) (Host) + ### May 21: [8 Real-World Query Anti-Patterns (and How to Fix Them)](https://www.youtube.com/live/jlR6KFuFODI?si=PSCUNSrqo0-fVDJw) From 74dc75f25fe24c4d250e30675a9105c6fa52a97c Mon Sep 17 00:00:00 2001 From: EduardF1 <50618110+EduardF1@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:41:59 +0200 Subject: [PATCH 29/36] Fix duplicate-word and garbled-word typos across documentation (#5401) --- entity-framework/core/get-started/winforms.md | 2 +- entity-framework/core/modeling/relationships.md | 2 +- .../core/testing/choosing-a-testing-strategy.md | 2 +- .../core/what-is-new/ef-core-10.0/breaking-changes.md | 2 +- entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md | 4 ++-- entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md | 2 +- entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md | 4 ++-- entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md | 6 +++--- .../ef6/modeling/code-first/data-types/spatial.md | 2 +- .../ef6/modeling/designer/advanced/edmx/csdl-spec.md | 2 +- .../ef6/modeling/designer/data-types/spatial.md | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/entity-framework/core/get-started/winforms.md b/entity-framework/core/get-started/winforms.md index e9f5f551dc..811e5c76e4 100644 --- a/entity-framework/core/get-started/winforms.md +++ b/entity-framework/core/get-started/winforms.md @@ -103,7 +103,7 @@ The application will show a list of categories and a list of products. When a ca 4. In the **Properties** for the first `DataGridView`, change the **Name** to `dataGridViewCategories`. 5. In the **Properties** for the second `DataGridView`, change the **Name** to `dataGridViewProducts`. 6. Also using the **Toolbox**, add a `Button` control. -7. Name the button `buttonSave` and give it the text "Save". The form should look something this this: +7. Name the button `buttonSave` and give it the text "Save". The form should look something like this: ![Form layout](_static/winforms-form-layout.png) diff --git a/entity-framework/core/modeling/relationships.md b/entity-framework/core/modeling/relationships.md index 938a13f22a..bc8dedcd0a 100644 --- a/entity-framework/core/modeling/relationships.md +++ b/entity-framework/core/modeling/relationships.md @@ -159,7 +159,7 @@ EF supports many different types of relationships, with many different ways thes - [_One-to-one relationships_](xref:core/modeling/relationships/one-to-one), in which a single entity is associated with another single entity. - [_Many-to-many relationships_](xref:core/modeling/relationships/many-to-many), in which any number of entities are associated with any number of other entities. -If you are new to EF, then trying the examples linked in in the bullet points above is a good way to get a feel for how relationships work. +If you are new to EF, then trying the examples linked in the bullet points above is a good way to get a feel for how relationships work. To dig deeper into the properties of entity types involved in relationship mapping, see: diff --git a/entity-framework/core/testing/choosing-a-testing-strategy.md b/entity-framework/core/testing/choosing-a-testing-strategy.md index ad8cd466a9..561969b24f 100644 --- a/entity-framework/core/testing/choosing-a-testing-strategy.md +++ b/entity-framework/core/testing/choosing-a-testing-strategy.md @@ -70,7 +70,7 @@ For information on how to use in-memory for testing, see the [see this section]( This approach typically uses a mock framework to create a test double of `DbContext` and `DbSet`, and tests against those doubles. Mocking `DbContext` can be a good approach for testing various *non-query* functionality, such as calls to or , allowing you to verify that your code called them in write scenarios. -However, properly mocking `DbSet` *query* functionality is not possible, since queries are expressed via LINQ operators, which are static extension method calls over `IQueryable`. As a result, when some people talk about "mocking `DbSet`", what they really mean is that they create a `DbSet` backed by an in-memory collection, and then evaluate query operators against that collection in memory, just like a simple `IEnumerable`. Rather than a mock, this is actually a sort of fake, where the in-memory collection replaces the the real database. +However, properly mocking `DbSet` *query* functionality is not possible, since queries are expressed via LINQ operators, which are static extension method calls over `IQueryable`. As a result, when some people talk about "mocking `DbSet`", what they really mean is that they create a `DbSet` backed by an in-memory collection, and then evaluate query operators against that collection in memory, just like a simple `IEnumerable`. Rather than a mock, this is actually a sort of fake, where the in-memory collection replaces the real database. Since only the `DbSet` itself is faked and the query is evaluated in-memory, this approach ends up being very similar to using the EF Core in-memory provider: both techniques execute query operators in .NET over an in-memory collection. As a result, this technique suffers from the same drawbacks as well: queries will behave differently (e.g. around case sensitivity) or will simply fail (e.g. because of provider-specific methods), raw SQL won't work and transactions will be ignored at best. As a result, this technique should generally be avoided for testing any query code. diff --git a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md index 05d3745f9e..0c50fec2d8 100644 --- a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md @@ -489,7 +489,7 @@ Starting with Microsoft.Data.Sqlite 10.0, when using `GetDateTimeOffset` on a te ##### Why -Is is to align with SQLite's behavior where timestamps without an offset are treated as UTC. +This is to align with SQLite's behavior where timestamps without an offset are treated as UTC. ##### Mitigations diff --git a/entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md index b33f1dbe0e..3132c0c8e3 100644 --- a/entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md @@ -713,7 +713,7 @@ After these improvements, the gap between the popular "micro-ORM" [Dapper](https EF Core 6.0 contains many improvements to the Azure Cosmos DB database provider. > [!TIP] -> You can run and debug into all the the Cosmos-specific samples by [downloading the sample code from GitHub](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/Miscellaneous/NewInEFCore6.Cosmos). +> You can run and debug into all the Cosmos-specific samples by [downloading the sample code from GitHub](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/Miscellaneous/NewInEFCore6.Cosmos). ### Default to implicit ownership @@ -2537,7 +2537,7 @@ For this reason, EF Core 6.0 will now warn you when saving an optional dependent > warn: 9/27/2021 09:25:01.338 RelationalEventId.OptionalDependentWithAllNullPropertiesWarning[20704] (Microsoft.EntityFrameworkCore.Update) > The entity of type 'Address' with primary key values {CustomerId: -2147482646} is an optional dependent using table sharing. The entity does not have any property with a non-default value to identify whether the entity exists. This means that when it is queried no object instance will be created instead of an instance with all properties set to default values. Any nested dependents will also be lost. Either don't save any instance with only default values or mark the incoming navigation as required in the model. -This becomes even more tricky where the optional dependent itself acts a a principal for a further optional dependent, also mapped to the same table. Rather than just warning, EF Core 6.0 disallows just cases of nested optional dependents. For example, consider the following model, where `ContactInfo` is owned by `Customer` and `Address` is in turned owned by `ContactInfo`: +This becomes even more tricky where the optional dependent itself acts as a principal for a further optional dependent, also mapped to the same table. Rather than just warning, EF Core 6.0 disallows just cases of nested optional dependents. For example, consider the following model, where `ContactInfo` is owned by `Customer` and `Address` is in turned owned by `ContactInfo`: [!code-csharp[SimpleInsert](../../../../samples/core/Miscellaneous/NewInEFCore7/SaveChangesPerformanceSample.cs?name=SimpleInsert)] -Shows that in EF Core 6.0, the `INSERT` command is wrapped by commands to begin and and then commit a transaction: +Shows that in EF Core 6.0, the `INSERT` command is wrapped by commands to begin and then commit a transaction: ```output dbug: 9/29/2022 11:43:09.196 RelationalEventId.TransactionStarted[20200] (Microsoft.EntityFrameworkCore.Database.Transaction) diff --git a/entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md index dd15bba7e2..d25ca6fe92 100644 --- a/entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md @@ -862,7 +862,7 @@ WHERE EXISTS ( WHERE [b].[value] = @__beer_0) ``` -`OpenJson` is now used to to extract values from JSON column so that each value can be matched to the passed parameter. +`OpenJson` is now used to extract values from JSON column so that each value can be matched to the passed parameter. We can combine the use of `OpenJson` on the parameter with `OpenJson` on the column. For example, to find pubs that stock any one of a variety of lagers: @@ -1242,7 +1242,7 @@ EF7 introduced support for mapping to JSON columns when using Azure SQL/SQL Serv The existing [documentation from What's New in EF7](xref:core/what-is-new/ef-core-7.0/whatsnew#json-columns) provides detailed information on JSON mapping, queries, and updates. This documentation now also applies to SQLite. > [!TIP] -> The code shown in the EF7 documentation has been updated to also run on SQLite can can be found in [JsonColumnsSample.cs](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/Miscellaneous/NewInEFCore8/JsonColumnsSample.cs). +> The code shown in the EF7 documentation has been updated to also run on SQLite and can be found in [JsonColumnsSample.cs](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/Miscellaneous/NewInEFCore8/JsonColumnsSample.cs). #### Queries into JSON columns diff --git a/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md index a0079a4672..e6398b4a44 100644 --- a/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md @@ -68,7 +68,7 @@ The logs show the following for this query: Executed ReadItem (73 ms, 1 RU) ActivityId='13f0f8b8-d481-47f0-bf41-67f7deb008b2', Container='test', Id='8', Partition='["someValue"]' ``` -Here, no SQL query is sent at all. Instead, the provider performs an an extremely efficient _point read_ (`ReadItem` API), which directly fetches the document given the partition key and ID. This is the most efficient and cost-effective kind of read you can perform in Azure Cosmos DB; [see the Azure Cosmos DB documentation](/azure/cosmos-db/nosql/how-to-dotnet-read-item) for more information about point reads. +Here, no SQL query is sent at all. Instead, the provider performs an extremely efficient _point read_ (`ReadItem` API), which directly fetches the document given the partition key and ID. This is the most efficient and cost-effective kind of read you can perform in Azure Cosmos DB; [see the Azure Cosmos DB documentation](/azure/cosmos-db/nosql/how-to-dotnet-read-item) for more information about point reads. To learn more about querying with partition keys and point reads, [see the querying documentation page](xref:core/providers/cosmos/querying). @@ -145,7 +145,7 @@ For more information, see the documentation on [querying with partition keys](xr ### Significantly improved LINQ querying capabilities -In EF 9.0, the LINQ translation capabilities of the the Azure Cosmos DB provider have been greatly expanded, and the provider can now execute significantly more query types. The full list of query improvements is too long to list, but here are the main highlights: +In EF 9.0, the LINQ translation capabilities of the Azure Cosmos DB provider have been greatly expanded, and the provider can now execute significantly more query types. The full list of query improvements is too long to list, but here are the main highlights: * Full support for EF's primitive collections, allowing you to perform LINQ querying on collections of e.g. ints or strings. See [What's new in EF8: primitive collections](xref:core/what-is-new/ef-core-8.0/whatsnew#primitive-collections) for more information. * Support for arbitrary querying over non-primitive collections. @@ -173,7 +173,7 @@ First, previous versions of EF inserted the discriminator value into the JSON `i } ``` -This was done in order to allow for documents of different types (e.g. Blog and Post) and the same key value (1099) to exist within the same container partition. Starting with EF 9.0, the `id` property contains contains only the key value: +This was done in order to allow for documents of different types (e.g. Blog and Post) and the same key value (1099) to exist within the same container partition. Starting with EF 9.0, the `id` property contains only the key value: ```json { diff --git a/entity-framework/ef6/modeling/code-first/data-types/spatial.md b/entity-framework/ef6/modeling/code-first/data-types/spatial.md index fb4f87eb57..027d9933df 100644 --- a/entity-framework/ef6/modeling/code-first/data-types/spatial.md +++ b/entity-framework/ef6/modeling/code-first/data-types/spatial.md @@ -94,7 +94,7 @@ public partial class UniversityContext : DbContext Open the Program.cs file where the Main method is defined. Add the following code into the Main function. -The code adds two new University objects to the context. Spatial properties are initialized by using the DbGeography.FromText method. The geography point represented as WellKnownText is passed to the method. The code then saves the data. Then, the LINQ query that that returns a University object where its location is closest to the specified location, is constructed and executed. +The code adds two new University objects to the context. Spatial properties are initialized by using the DbGeography.FromText method. The geography point represented as WellKnownText is passed to the method. The code then saves the data. Then, the LINQ query that returns a University object where its location is closest to the specified location, is constructed and executed. ``` csharp using (var context = new UniversityContext ()) diff --git a/entity-framework/ef6/modeling/designer/advanced/edmx/csdl-spec.md b/entity-framework/ef6/modeling/designer/advanced/edmx/csdl-spec.md index 01c8667ae6..c24cc9ac2a 100644 --- a/entity-framework/ef6/modeling/designer/advanced/edmx/csdl-spec.md +++ b/entity-framework/ef6/modeling/designer/advanced/edmx/csdl-spec.md @@ -184,7 +184,7 @@ The following table describes the attributes that can be applied to the **Collec ### Example -The following example shows a model-defined function that that uses a **CollectionType** element to specify that the function returns a collection of **Person** entity types (as specified with the **ElementType** attribute). +The following example shows a model-defined function that uses a **CollectionType** element to specify that the function returns a collection of **Person** entity types (as specified with the **ElementType** attribute). ``` xml diff --git a/entity-framework/ef6/modeling/designer/data-types/spatial.md b/entity-framework/ef6/modeling/designer/data-types/spatial.md index e224e7b238..14fc77d4ca 100644 --- a/entity-framework/ef6/modeling/designer/data-types/spatial.md +++ b/entity-framework/ef6/modeling/designer/data-types/spatial.md @@ -92,7 +92,7 @@ Now we can generate a database that is based on the model. Open the Program.cs file where the Main method is defined. Add the following code into the Main function. -The code adds two new University objects to the context. Spatial properties are initialized by using the DbGeography.FromText method. The geography point represented as WellKnownText is passed to the method. The code then saves the data. Then, the LINQ query that that returns a University object where its location is closest to the specified location, is constructed and executed. +The code adds two new University objects to the context. Spatial properties are initialized by using the DbGeography.FromText method. The geography point represented as WellKnownText is passed to the method. The code then saves the data. Then, the LINQ query that returns a University object where its location is closest to the specified location, is constructed and executed. ``` csharp using (var context = new UniversityModelContainer()) From 445299399531845c2c53087ea37cc460ca8c1d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Cincura=20=E2=86=B9?= Date: Mon, 29 Jun 2026 20:49:32 +0200 Subject: [PATCH 30/36] Update standups page date (#5404) --- entity-framework/core/learn-more/community-standups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/learn-more/community-standups.md b/entity-framework/core/learn-more/community-standups.md index 090af9a6c5..d86e8d6385 100644 --- a/entity-framework/core/learn-more/community-standups.md +++ b/entity-framework/core/learn-more/community-standups.md @@ -2,7 +2,7 @@ title: .NET Data Community Standups description: Details and links for each episode of the .NET Data Community Standup author: SamMonoRT -ms.date: 02/23/2024 +ms.date: 06/26/2026 uid: core/learn-more/community-standups --- From 16e474b58151684c890eb0041ef84f38e59610d3 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 09:01:21 -0400 Subject: [PATCH 31/36] Document SQL parameter name simplification as a low-impact breaking change in EF Core 10 (#5406) --- .../ef-core-10.0/breaking-changes.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md index 0c50fec2d8..bff4e83ec0 100644 --- a/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-10.0/breaking-changes.md @@ -31,6 +31,7 @@ This page documents API and behavior changes that have the potential to break ex | [Nested complex type properties use full path in column names](#nested-complex-type-column-names) | Low | | [IDiscriminatorPropertySetConvention signature changed](#discriminator-convention-signature) | Low | | [IRelationalCommandDiagnosticsLogger methods add logCommandText parameter](#logger-logcommandtext) | Low | +| [SQL parameter names are now simplified](#simplified-parameter-names) | Low | ## Medium-impact changes @@ -459,6 +460,46 @@ public InterceptionResult CommandReaderExecuting( The `logCommandText` parameter contains the SQL to be logged (with inlined constants potentially redacted), while `command.CommandText` contains the actual SQL that will be executed against the database. + + +### SQL parameter names are now simplified + +[Tracking Issue #35196](https://github.com/dotnet/efcore/issues/35196) + +#### Old behavior + +Previously, EF generated SQL parameter names with a `__` prefix and a trailing counter. For example, a query referencing a `city` variable produced a parameter named `@__city_0`: + +```sql +@__city_0='London' + +SELECT [b].[Id], [b].[Name] +FROM [Blogs] AS [b] +WHERE [b].[City] = @__city_0 +``` + +#### New behavior + +Starting with EF Core 10.0, parameter names are simplified to match the originating variable or member name, and a numeric suffix is only added when needed to make a name unique. The same query now produces a parameter named `@city`: + +```sql +@city='London' + +SELECT [b].[Id], [b].[Name] +FROM [Blogs] AS [b] +WHERE [b].[City] = @city +``` + +#### Why + +The previous `__` prefix and unconditional counter made the generated SQL harder to read in logs, query plans, and diagnostic output. The simplified names more closely resemble SQL that a developer would write by hand and make it easier to correlate parameters with the variables in your code. + +#### Mitigations + +This change is transparent for most applications, since EF manages parameter names internally and the executed queries are functionally identical. However, code that depends on the exact parameter names in the generated SQL - such as snapshot tests comparing SQL text, or interceptors and loggers that parse `DbCommand.CommandText` or inspect `DbParameter.ParameterName` - needs to be updated to account for the new names. + +Since parameter names are part of the generated SQL text, upgrading may also cause almost all cached query plans to be recompiled on the database server. Large systems should account for a temporary compilation spike immediately after deployment while those plans are rebuilt. + ## Microsoft.Data.Sqlite breaking changes From 816533531b2b1d1b2987e724a489318e4c030c97 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Jul 2026 11:37:40 -0700 Subject: [PATCH 32/36] Document Cosmos DB id mapping changes in EF Core 9.0 and add SDK migration scripts (#5414) Fixes #4883 Fixes #4821 Co-authored-by: Andriy Svyryd --- .../core/providers/cosmos/modeling.md | 28 +++++ .../ef-core-9.0/breaking-changes.md | 113 +++++++++++++++++- 2 files changed, 139 insertions(+), 2 deletions(-) diff --git a/entity-framework/core/providers/cosmos/modeling.md b/entity-framework/core/providers/cosmos/modeling.md index 50ec61e101..3a67fb15df 100644 --- a/entity-framework/core/providers/cosmos/modeling.md +++ b/entity-framework/core/providers/cosmos/modeling.md @@ -29,6 +29,16 @@ Before mapping entity types to different containers, make sure you understand th Azure Cosmos DB requires all documents to have an `id` JSON property which uniquely identifies them. Like other EF providers, the EF Azure Cosmos DB provider will attempt to find a property named `Id` or `Id`, and configure that property as the key of your entity type, mapping it to the `id` JSON property. You can configure any property to be the key property by using ; see [the general EF documentation on keys](xref:core/modeling/keys) for more information. +Starting with EF 9.0, the entity's key property is directly mapped to the JSON `id` property — they are one and the same property in the document. This means the key value is not stored twice. For example, a `Blog` entity with `Id = 8` produces a document where the `id` property contains the string value `"8"`: + +```json +{ + "id": "8", + "$type": "Blog", + ... +} +``` + Developers coming to Azure Cosmos DB from other databases sometimes expect the key (`Id`) property to be generated automatically. For example, on SQL Server, EF configures numeric key properties to be IDENTITY columns, where auto-incrementing values are generated in the database. In contrast, Azure Cosmos DB does not support automatic generation of properties, and so key properties must be explicitly set. Inserting an entity type with an unset key property will simply insert the CLR default value for that property (e.g. 0 for `int`), and a second insert will fail; EF issues a warning if you attempt to do this. If you'd like to have a GUID as your key property, you can configure EF to generate unique, random values at the client: @@ -37,6 +47,24 @@ If you'd like to have a GUID as your key property, you can configure EF to gener modelBuilder.Entity().Property(b => b.Id).HasValueGenerator(); ``` +### Shadow id + +In some cases where a direct mapping to `id` is not possible, EF creates a shadow property that maps to the JSON `id`. This shadow property contains a synthesized value (combining the key and potentially other properties, separated by `|`) that uniquely identifies the document. EF manages this shadow property automatically, but its presence means the key property is stored separately in the document under its own name in addition to the `id` property. + +You can also explicitly configure EF to use a shadow `id` property by calling : + +```csharp +modelBuilder.Entity().HasShadowId(); +``` + +Or configure all entity types at once: + +```csharp +modelBuilder.HasShadowIds(); +``` + +This was the default behavior prior to EF 9.0. If you are upgrading from EF 8, see the [breaking change documentation](xref:core/what-is-new/ef-core-9.0/breaking-changes#cosmos-key-changes) for more information. + ## Partition keys Azure Cosmos DB uses partitioning to achieve horizontal scaling; proper modeling and careful selection of the partition key is vital for achieving good performance and keeping costs down. It's highly recommended to read [the Azure Cosmos DB documentation on partitioning](/azure/cosmos-db/partition-data) and to plan your partitioning strategy in advance. diff --git a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md index b0e76a7f4c..bb4a1004fe 100644 --- a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md @@ -436,7 +436,38 @@ modelBuilder.Entity().HasDiscriminator("Discriminator"); Doing this for all your top-level entity types will make EF behave just like before. -At this point, if you wish, you can also update all your documents to use the new `$type` naming. +Alternatively, if you wish to update all your documents to use the new `$type` naming so that you no longer need the configuration above, you can do so using the Azure Cosmos DB SDK. The following code renames the `Discriminator` property to `$type` in all documents in a container: + +```csharp +using Microsoft.Azure.Cosmos; +using System.Text.Json.Nodes; + +// Replace with your Cosmos DB connection string. +var cosmosClient = new CosmosClient(connectionString); +var container = cosmosClient.GetContainer("myDatabase", "myContainer"); + +using var feedIterator = container.GetItemQueryIterator("SELECT * FROM c WHERE IS_DEFINED(c.Discriminator)"); +while (feedIterator.HasMoreResults) +{ + foreach (var item in await feedIterator.ReadNextAsync()) + { + if (item.ContainsKey("Discriminator")) + { + item["$type"] = item["Discriminator"]!.DeepClone(); + item.Remove("Discriminator"); + + // The id and partition key are required for ReplaceItemAsync. + // Adjust the partition key extraction to match your container's partition key path. + var id = item["id"]!.GetValue(); + var partitionKey = new PartitionKey(item["myPartitionKeyProperty"]!.GetValue()); + await container.ReplaceItemAsync(item, id, partitionKey); + } + } +} +``` + +> [!NOTE] +> Replace `myPartitionKeyProperty` with the name of the property that is configured as the partition key in your container. If your container uses the document `id` as the partition key, use `id` for the partition key value as well. @@ -468,7 +499,55 @@ modelBuilder.Entity().HasDiscriminatorInJsonId(); Doing this for all your top-level entity types will make EF behave just like before. -At this point, if you wish, you can also update all your documents to rewrite their JSON `id` property. Note that this is only possible if entities of different types don't share the same id value within the same container. +Alternatively, if you wish to update all your existing documents to remove the discriminator value from the `id` property so that you no longer need the configuration above, you can do so using the Azure Cosmos DB SDK. Note that this is only possible if entities of different types don't share the same key value within the same container partition. + +Azure Cosmos DB does not allow updating the `id` property of an existing document; instead, you must delete the old document and create a new one with the updated `id`. The following code performs this migration: + +```csharp +using Microsoft.Azure.Cosmos; +using System.Text.Json.Nodes; + +// Replace with your Cosmos DB connection string. +var cosmosClient = new CosmosClient(connectionString); +var container = cosmosClient.GetContainer("myDatabase", "myContainer"); + +// Replace with the name of the property configured as the partition key in your container. +// If the partition key path is /id, set this to "id". +const string partitionKeyProperty = "myPartitionKeyProperty"; + +using var feedIterator = container.GetItemQueryIterator("SELECT * FROM c"); +while (feedIterator.HasMoreResults) +{ + foreach (var item in await feedIterator.ReadNextAsync()) + { + var oldId = item["id"]!.GetValue(); + var separatorIndex = oldId.IndexOf('|'); + if (separatorIndex != -1) + { + var newId = oldId[(separatorIndex + 1)..]; + + // Capture the partition key value before updating the id. + // When partitionKeyProperty is "id", this captures the old id for the delete operation. + var partitionKeyForDelete = new PartitionKey(item[partitionKeyProperty]!.GetValue()); + + // Update the id to the new value without the discriminator prefix. + item["id"] = JsonValue.Create(newId); + + // When partitionKeyProperty is "id", read it again after the update to get the new id for the create operation. + var partitionKeyForCreate = new PartitionKey(item[partitionKeyProperty]!.GetValue()); + + // Azure Cosmos DB does not allow changing the id - create a new document and delete the old one. + await container.CreateItemAsync(item, partitionKeyForCreate); + await container.DeleteItemAsync(oldId, partitionKeyForDelete); + } + } +} +``` + +> [!NOTE] +> Set `partitionKeyProperty` to the name of the property configured as the partition key in your container. When the partition key path is `/id`, the sample correctly uses the old `id` value for the delete operation and the new `id` value for the create operation, since `partitionKeyProperty` is read both before and after updating `item["id"]`. +> +> If a crash occurs between the `CreateItemAsync` and `DeleteItemAsync` calls, you may end up with both documents. When re-running the migration, handle this by catching `409 Conflict` from `CreateItemAsync` and proceeding to the `DeleteItemAsync` call to remove the old document. @@ -502,6 +581,36 @@ Doing this for all your top-level entity types will make EF behave just like bef modelBuilder.HasShadowIds(); ``` +Alternatively, if you wish to adopt the new EF 9.0 behavior and your existing documents contain the key property stored separately (e.g., as `"Id": 8` alongside `"id": "Blog|8"`), you can remove the redundant key property using the Azure Cosmos DB SDK. If you are also migrating the `id` property format (removing the discriminator prefix), you can combine both steps as shown in the [`id` property migration above](#cosmos-id-property-changes). The following example removes a redundant `"Id"` property if the `id` migration has already been performed: + +```csharp +using Microsoft.Azure.Cosmos; +using System.Text.Json.Nodes; + +// Replace with your Cosmos DB connection string. +var cosmosClient = new CosmosClient(connectionString); +var container = cosmosClient.GetContainer("myDatabase", "myContainer"); + +// Adjust "Id" to match your entity's key property name. +using var feedIterator = container.GetItemQueryIterator("SELECT * FROM c WHERE IS_DEFINED(c.Id)"); +while (feedIterator.HasMoreResults) +{ + foreach (var item in await feedIterator.ReadNextAsync()) + { + item.Remove("Id"); + + var id = item["id"]!.GetValue(); + + // Adjust the partition key extraction to match your container's partition key path. + var partitionKey = new PartitionKey(item["myPartitionKeyProperty"]!.GetValue()); + await container.ReplaceItemAsync(item, id, partitionKey); + } +} +``` + +> [!NOTE] +> Replace `Id` with the name of your entity's key property and `myPartitionKeyProperty` with the name of the property configured as the partition key in your container. + ### Medium-impact changes From f62650add1ce2a16e93080792c9b3cae90abe4ec Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Jul 2026 13:03:01 -0700 Subject: [PATCH 33/36] Document EF Core 9 breaking change: NoTrackingWithIdentityResolution restricted for JSON collection queries (#5413) Fixes #4932 Co-authored-by: Andriy Svyryd --- .../ef-core-9.0/breaking-changes.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md index bb4a1004fe..1e31fc741a 100644 --- a/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-9.0/breaking-changes.md @@ -35,6 +35,7 @@ EF Core 9 targets .NET 8. This means that existing applications that target .NET | [Shared framework dependencies were updated to 9.0.x](#shared-framework-dependencies) | Low | | [EF tools no longer support .NET Framework projects](#ef-tools-no-netfx) | Low | | [`EF.Constant()` and `EF.Parameter()` no longer work inside compiled queries](#ef-constant-compiled) | Low | +| [Some `NoTrackingWithIdentityResolution` queries are now prohibited for JSON collections](#no-tracking-json) | Low | ## High-impact changes @@ -389,6 +390,66 @@ The internal implementation of Either remove the or call from the compiled query, or stop using a compiled query for that particular query. Note that removing `EF.Constant()` causes the value to be sent as a SQL parameter rather than inlined as a constant, which may affect query plan performance. + + +### Some `NoTrackingWithIdentityResolution` queries are now prohibited for JSON collections + +[Tracking Issue #33073](https://github.com/dotnet/efcore/issues/33073) + +#### Old behavior + +Previously, using (or setting ) with queries that include JSON-mapped entity collections could silently produce incorrect results or data corruption, depending on the order in which entities were processed during materialization. Additionally, such queries could throw an unhelpful `Invalid token type: 'StartObject'` exception in some scenarios. + +#### New behavior + +Starting with EF Core 9.0, EF Core restricts the use of for certain JSON collection query patterns, to prevent silent data corruption: + +- If entity instances in a JSON collection would be materialized in an order that could cause data corruption, EF Core throws an exception instructing the user to use a different tracking behavior. +- Using LINQ operators (such as `OrderBy`, `Where`, `Skip`, `Take`, etc.) directly on JSON collection navigations in a query with `AsNoTrackingWithIdentityResolution()` is now prohibited. For example, the following query would throw an exception: + +```csharp +var blogs = await context.Blogs + .AsNoTrackingWithIdentityResolution() + .Select(b => new + { + Blog = b, + TopPosts = b.JsonPosts.OrderBy(p => p.Rating).Take(3).ToList() + }) + .ToListAsync(); +``` + +#### Why + +The combination of and JSON collections could silently produce incorrect materialized objects due to how JSON is streamed from the database: nested includes in JSON are part of the parent's materialization rather than being materialized separately. The stand-alone change tracker used for identity resolution relies on key values to deduplicate entity instances, but when LINQ operators are applied to JSON collections, EF Core cannot reliably propagate those key values to the materializer, resulting in entities with null keys and potential data corruption. + +#### Mitigations + +Use a regular tracking query if identity resolution is required: + +```csharp +var blogs = await context.Blogs + .AsTracking() + .Select(b => new + { + Blog = b, + TopPosts = b.JsonPosts.OrderBy(p => p.Rating).Take(3).ToList() + }) + .ToListAsync(); +``` + +If you do not need identity resolution, use instead: + +```csharp +var blogs = await context.Blogs + .AsNoTracking() + .Select(b => new + { + Blog = b, + TopPosts = b.JsonPosts.OrderBy(p => p.Rating).Take(3).ToList() + }) + .ToListAsync(); +``` + ## Azure Cosmos DB breaking changes Extensive work has gone into making the Azure Cosmos DB provider better in 9.0. The changes include a number of high-impact breaking changes; if you are upgrading an existing application, please read the following carefully. From bf3cc1907cb2b48813467cacddda9a51f3e1e580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Say=C4=B1n?= Date: Wed, 8 Jul 2026 21:12:33 +0300 Subject: [PATCH 34/36] Add note about EF Core 9 PendingModelChangesWarning behavior (#5402) --- entity-framework/core/managing-schemas/migrations/managing.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entity-framework/core/managing-schemas/migrations/managing.md b/entity-framework/core/managing-schemas/migrations/managing.md index 2f903799bd..5bba197abf 100644 --- a/entity-framework/core/managing-schemas/migrations/managing.md +++ b/entity-framework/core/managing-schemas/migrations/managing.md @@ -221,6 +221,9 @@ dotnet ef migrations has-pending-model-changes You can also perform this check programmatically using `context.Database.HasPendingModelChanges()`. This can be used to write a unit test that fails when you forget to add a migration. +> [!NOTE] +> Starting with EF Core 9, calling or with pending model changes throws an exception (event ID ). See the [applying migrations documentation](xref:core/managing-schemas/migrations/applying#apply-migrations-at-runtime) and the [breaking change note](xref:core/what-is-new/ef-core-9.0/breaking-changes#pending-model-changes) for more information. + ## Resetting all migrations In some extreme cases, it may be necessary to remove all migrations and start over. This can be easily done by deleting your **Migrations** folder and dropping your database; at that point you can create a new initial migration, which will contain your entire current schema. From 28d873ad2afc32a80109ce269bfbfc33948a6e64 Mon Sep 17 00:00:00 2001 From: Andriy Svyryd Date: Mon, 13 Jul 2026 10:59:03 -0700 Subject: [PATCH 35/36] Preview.6 docs (#5410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document EF Core 11 FullJoin support (#5374) Document EF Core 11 indexing enhancements (#5380) Document runtime migration creation (`--add` option for `database update`) (#5384) Document obsoletion of owned JSON collections without an explicit key (EF11) (#5383) Document Microsoft.Data.Sqlite SQLite3MC breaking change (#5385) Document sqlite3mc glibc requirement and SQLite fallback paths in EF Core 11 breaking changes (#5407) Document PR #38440 provider-facing breaking change Add xUnit v3 upgrade as a test change in provider-facing changes Add PR #38192 (complex-type keys/indexes) as a provider-facing change (#5392) Fixes #5246 Fixes #5238 Co-authored-by: Andriy Svyryd Co-authored-by: Shay Rojansky Co-authored-by: Jiri Cincura ↹ --- entity-framework/core/cli/dotnet.md | 12 +- entity-framework/core/cli/powershell.md | 9 + .../managing-schemas/migrations/managing.md | 31 +++ entity-framework/core/modeling/indexes.md | 62 +++++- entity-framework/core/modeling/keys.md | 20 +- .../core/providers/cosmos/modeling.md | 43 +++- .../core/providers/sql-server/index.md | 32 ++- .../providers/sql-server/vector-search.md | 32 +-- .../core/providers/sqlite/functions.md | 2 + .../ef-core-11.0/breaking-changes.md | 174 ++++++++++++++- .../ef-core-11.0/provider-facing-changes.md | 5 +- .../core/what-is-new/ef-core-11.0/whatsnew.md | 207 +++++++++++++++++- 12 files changed, 600 insertions(+), 29 deletions(-) diff --git a/entity-framework/core/cli/dotnet.md b/entity-framework/core/cli/dotnet.md index 1f0e66d35c..3217b723fc 100644 --- a/entity-framework/core/cli/dotnet.md +++ b/entity-framework/core/cli/dotnet.md @@ -152,7 +152,10 @@ Options: | Option | Description | |:------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------| -| `--connection ` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. | +| `--connection ` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. | +| `--add` | Creates a new migration and applies it to the database in a single step. Uses Roslyn to compile the migration at runtime. When specified, the `` argument is required and provides the name for the new migration. Added in EF Core 11. | +| `--output-dir ` | The directory to put migration files in. Paths are relative to the target project directory. Requires `--add`. Added in EF Core 11. | +| `--namespace ` | The namespace to use for the generated migration classes. Requires `--add`. Added in EF Core 11. | The [common options](#common-options) are listed above. @@ -163,6 +166,13 @@ dotnet ef database update InitialCreate dotnet ef database update 20180904195021_InitialCreate --connection your_connection_string ``` +The following examples create a new migration and apply it to the database in one step: + +```dotnetcli +dotnet ef database update InitialCreate --add +dotnet ef database update AddProducts --add --output-dir Migrations/Products --namespace MyApp.Migrations +``` + ## `dotnet ef dbcontext info` Gets information about a `DbContext` type. diff --git a/entity-framework/core/cli/powershell.md b/entity-framework/core/cli/powershell.md index 8868bcd962..307c71e0a3 100644 --- a/entity-framework/core/cli/powershell.md +++ b/entity-framework/core/cli/powershell.md @@ -316,6 +316,9 @@ Updates the database to the last migration or to a specified migration. |:------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `-Migration ` | The target migration. Migrations may be identified by name or by ID. The number 0 is a special case that means *before the first migration* and causes all migrations to be reverted. If no migration is specified, the command defaults to the last migration. | | `-Connection ` | The connection string to the database. Defaults to the one specified in `AddDbContext` or `OnConfiguring`. | +| `-Add` | Creates a new migration and applies it to the database in a single step. Uses Roslyn to compile the migration at runtime. When specified, a migration name is required and provides the name for the new migration. Added in EF Core 11. | +| `-OutputDir ` | The directory to put migration files in. Paths are relative to the target project directory. Requires `-Add`. Added in EF Core 11. | +| `-Namespace ` | The namespace to use for the generated migration classes. Requires `-Add`. Added in EF Core 11. | The [common parameters](#common-parameters) are listed above. @@ -335,6 +338,12 @@ Update-Database InitialCreate Update-Database 20180904195021_InitialCreate -Connection your_connection_string ``` +The following example creates a new migration and applies it to the database in one step: + +```powershell +Update-Database -Migration InitialCreate -Add +``` + ## Additional resources * [Migrations](xref:core/managing-schemas/migrations/index) diff --git a/entity-framework/core/managing-schemas/migrations/managing.md b/entity-framework/core/managing-schemas/migrations/managing.md index 5bba197abf..07455abe07 100644 --- a/entity-framework/core/managing-schemas/migrations/managing.md +++ b/entity-framework/core/managing-schemas/migrations/managing.md @@ -65,6 +65,37 @@ Add-Migration InitialCreate -OutputDir Your\Directory *** +## Create and apply a migration in one step + +> [!NOTE] +> This feature was added in EF Core 11. + +The `dotnet ef database update` command supports creating and applying a migration in a single step using the `--add` option. This uses Roslyn to compile the migration at runtime, enabling scenarios like .NET Aspire and containerized applications where the application cannot be stopped and rebuilt: + +### [.NET CLI](#tab/dotnet-core-cli) + +```dotnetcli +dotnet ef database update InitialCreate --add +``` + +The same options available for `dotnet ef migrations add` can be used: + +```dotnetcli +dotnet ef database update AddProducts --add --output-dir Migrations/Products --namespace MyApp.Migrations +``` + +### [Visual Studio](#tab/vs) + +```powershell +Update-Database -Migration InitialCreate -Add +``` + +*** + +This command scaffolds a new migration with the specified name, compiles it using Roslyn, and immediately applies it to the database. The migration files are still saved to disk for source control and future recompilation. + +If no pending model changes are detected, the command applies any existing pending migrations without creating a new one. + ## Customize migration code While EF Core generally creates accurate migrations, you should always review the code and make sure it corresponds to the desired change; in some cases, it is even necessary to do so. diff --git a/entity-framework/core/modeling/indexes.md b/entity-framework/core/modeling/indexes.md index 0760817b0d..854c942bc9 100644 --- a/entity-framework/core/modeling/indexes.md +++ b/entity-framework/core/modeling/indexes.md @@ -2,7 +2,7 @@ title: Indexes - EF Core description: Configuring indexes in an Entity Framework Core model author: SamMonoRT -ms.date: 10/1/2021 +ms.date: 06/09/2026 uid: core/modeling/indexes --- # Indexes @@ -40,6 +40,58 @@ An index can also span more than one column: Indexes over multiple columns, also known as *composite indexes*, speed up queries which filter on index's columns, but also queries which only filter on the *first* columns covered by the index. See the [performance docs](xref:core/performance/efficient-querying#use-indexes-properly) for more information. +## Indexes on complex type properties + +Starting with EF Core 11.0, indexes can use scalar properties nested inside [complex types](xref:core/what-is-new/ef-core-10.0/whatsnew#complex-types): + +```csharp +modelBuilder.Entity() + .HasIndex(c => c.Address.PostalCode); +``` + +Composite indexes can mix regular entity properties and complex type properties: + +```csharp +modelBuilder.Entity() + .HasIndex(c => new { c.Region, c.Address.PostalCode }); +``` + +The same paths can be specified by name: + +```csharp +modelBuilder.Entity() + .HasIndex("Address.PostalCode"); +``` + +For complex types mapped to JSON columns, providers may also support indexing paths inside the JSON document: + +```csharp +modelBuilder.Entity() + .ComplexProperty(c => c.Address, b => b.ToJson()); + +modelBuilder.Entity() + .HasIndex("Address.PostalCode"); +``` + +Indexes over complex collections use collection path syntax. `[]` represents all elements, while `[0]`, `[1]`, and so on represent a specific element: + +```csharp +modelBuilder.Entity() + .ComplexCollection(o => o.Items, b => b.ToJson()); + +modelBuilder.Entity() + .HasIndex("Items[].Sku"); +``` + +The same index can be configured with a lambda expression using `Select`: + +```csharp +modelBuilder.Entity() + .HasIndex(o => o.Items.Select(i => i.Sku)); +``` + +Support for JSON-path indexes depends on the database provider. For example, the SQL Server provider creates SQL Server JSON indexes where supported, while the Azure Cosmos DB provider emits the configured paths into the container indexing policy. + ## Index uniqueness By default, indexes aren't unique: multiple rows are allowed to have the same value(s) for the index's column set. You can make an index unique as follows: @@ -148,6 +200,14 @@ In the following example, the `Url` column is part of the index key, so any quer [!code-csharp[Main](../../../samples/core/Modeling/IndexesAndConstraints/FluentAPI/IndexInclude.cs?name=IndexInclude&highlight=5-9)] +Starting with EF Core 11.0, SQL Server included columns can also refer to scalar properties nested inside complex types: + +```csharp +modelBuilder.Entity() + .HasIndex(c => c.Name) + .IncludeProperties(c => c.Address.City); +``` + ## Check constraints Check constraints are a standard relational feature that allows you to define a condition that must hold for all rows in a table; any attempt to insert or modify data that violates the constraint will fail. Check constraints are similar to non-null constraints (which prohibit nulls in a column) or to unique constraints (which prohibit duplicates), but allow arbitrary SQL expression to be defined. diff --git a/entity-framework/core/modeling/keys.md b/entity-framework/core/modeling/keys.md index 50c27ac7c2..caa8a83768 100644 --- a/entity-framework/core/modeling/keys.md +++ b/entity-framework/core/modeling/keys.md @@ -2,7 +2,7 @@ title: Keys - EF Core description: How to configure keys for entity types when using Entity Framework Core author: AndriySvyryd -ms.date: 10/14/2022 +ms.date: 06/09/2026 uid: core/modeling/keys --- # Keys @@ -53,6 +53,24 @@ public class Car *** +## Keys on complex type properties + +Starting with EF Core 11.0, keys can use scalar properties nested inside non-collection [complex types](xref:core/what-is-new/ef-core-10.0/whatsnew#complex-types). + +```csharp +modelBuilder.Entity() + .HasKey(c => c.CustomerId.Value); +``` + +The same path can be specified by name: + +```csharp +modelBuilder.Entity() + .HasKey("CustomerId.Value"); +``` + +Complex properties on the path to a key property are required. Keys can't traverse complex collections or nullable complex properties. + ## Value generation For non-composite numeric and GUID primary keys, EF Core sets up value generation for you by convention. For example, a numeric primary key in SQL Server is automatically set up to be an IDENTITY column. For more information, see [the documentation on value generation](xref:core/modeling/generated-properties) and [guidance for specific inheritance mapping strategies](xref:core/modeling/inheritance#key-generation). diff --git a/entity-framework/core/providers/cosmos/modeling.md b/entity-framework/core/providers/cosmos/modeling.md index 3a67fb15df..7d477b876a 100644 --- a/entity-framework/core/providers/cosmos/modeling.md +++ b/entity-framework/core/providers/cosmos/modeling.md @@ -2,7 +2,7 @@ title: Modeling - Azure Cosmos DB Provider - EF Core description: Configuring the model with the Azure Cosmos DB EF Core Provider author: SamMonoRT -ms.date: 09/26/2024 +ms.date: 06/09/2026 uid: core/providers/cosmos/modeling --- # Configuring the model with the EF Core Azure Cosmos DB Provider @@ -95,6 +95,47 @@ If you don't configure a partition key with EF, a warning will be logged at star Once your partition key properties are properly configured, you can provide values for them in queries; see [Querying with partition keys](xref:core/providers/cosmos/querying#partition-keys) for more information. +## Indexing policy + +Starting with EF Core 11.0, the Azure Cosmos DB provider emits more of the EF model's index configuration into the container [indexing policy](/azure/cosmos-db/index-policy). + +By default, Azure Cosmos DB automatically indexes all properties. You can configure this automatic indexing policy and exclude individual paths: + +```csharp +modelBuilder.Entity() + .HasAutomaticIndexing() + .Except("/InternalNotes/?"); +``` + +To index only explicitly configured paths, configure indexes with `HasIndex`. Automatic indexing is disabled automatically as soon as any single-property index is defined, so there is no need to call `HasAutomaticIndexing(false)` explicitly: + +```csharp +modelBuilder.Entity(b => +{ + b.HasIndex(o => o.OrderNumber); + b.HasIndex(o => new { o.CustomerId, o.OrderDate }); +}); +``` + +When automatic indexing is enabled, single-property indexes are already covered by the default `/*` included path and aren't emitted separately. Composite, vector, and full-text indexes are always emitted. + +Indexes can also traverse complex type properties and complex collections. In a string path, `[]` represents all elements of a collection: + +```csharp +modelBuilder.Entity(b => +{ + b.ComplexCollection(o => o.Items); + b.HasIndex("Items[].Sku"); +}); +``` + +The same index can be configured with a lambda expression: + +```csharp +modelBuilder.Entity() + .HasIndex(o => o.Items.Select(i => i.Sku)); +``` + ## Discriminators Since multiple entity types may be mapped to the same container, EF Core always adds a `$type` discriminator property to all JSON documents you save (this property was called `Discriminator` before EF 9.0); this allows EF to recognize documents being loaded from the database, and materialize the right .NET type. Developers coming from relational databases may be familiar with discriminators in the context of [table-per-hierarchy inheritance (TPH)](xref:core/modeling/inheritance#table-per-hierarchy-and-discriminator-configuration); in Azure Cosmos DB, discriminators are used not just in inheritance mapping scenarios, but also because the same container can contain completely different document types. diff --git a/entity-framework/core/providers/sql-server/index.md b/entity-framework/core/providers/sql-server/index.md index 56d3210ba0..5512f5f984 100644 --- a/entity-framework/core/providers/sql-server/index.md +++ b/entity-framework/core/providers/sql-server/index.md @@ -2,7 +2,7 @@ title: Microsoft SQL Server Database Provider - EF Core description: Documentation for the database provider that allows Entity Framework Core to be used with Microsoft SQL Server author: AndriySvyryd -ms.date: 11/15/2021 +ms.date: 06/09/2026 uid: core/providers/sql-server/index --- # Microsoft SQL Server EF Core Database Provider @@ -113,6 +113,36 @@ To configure EF with a compatibility level, use `UseCompatibilityLevel()` as fol optionsBuilder.UseSqlServer("", o => o.UseCompatibilityLevel(170)); ``` +## JSON indexes + +Starting with EF Core 11.0, the SQL Server provider can create and scaffold [SQL Server JSON indexes](/sql/t-sql/statements/create-json-index-transact-sql) for paths inside complex types mapped to JSON columns. + +For example, the following maps a complex type to a JSON column and creates a JSON index over a nested property: + +```csharp +modelBuilder.Entity() + .ComplexProperty(c => c.Contact, b => b.ToJson().HasColumnType("json")); + +modelBuilder.Entity() + .HasIndex("Contact.Address.City"); +``` + +When SQL Server JSON indexes are supported, migrations generate SQL similar to: + +```sql +CREATE JSON INDEX [IX_Customers_Contact_Address_City] +ON [Customers]([Contact]) FOR (N'$.Address.City'); +``` + +Multiple paths inside the same JSON column can be indexed together: + +```csharp +modelBuilder.Entity() + .HasIndex(["Contact.Address.City", "Contact.PhoneNumber"]); +``` + +Paths through JSON arrays can use numeric indexers, for example `Orders[0].Number`. SQL Server JSON indexes don't support wildcard indexes over every array element. + ## Connection resiliency EF includes functionality for automatically retrying failed database commands; for more information, [see the documentation](xref:core/miscellaneous/connection-resiliency). When using and , connection resiliency is automatically set up with the appropriate settings specific for those databases. Otherwise, when using , configure the provider with as shown in the connection resiliency documentation. diff --git a/entity-framework/core/providers/sql-server/vector-search.md b/entity-framework/core/providers/sql-server/vector-search.md index 6a47ca7b05..370b7614db 100644 --- a/entity-framework/core/providers/sql-server/vector-search.md +++ b/entity-framework/core/providers/sql-server/vector-search.md @@ -196,25 +196,31 @@ SqlVector queryEmbedding = ...; var results = await context.Articles // Perform full-text search .FreeTextTable(textualQuery, topN: k) + .Join( + context.Articles, + fts => fts.Key, + a => a.Id, + (fts, a) => new { Article = a, fts.Rank }) // Perform vector (semantic) search, joining the results of both searches together - .LeftJoin( + .FullJoin( context.Articles.VectorSearch(b => b.Embedding, queryEmbedding, "cosine") .OrderBy(r => r.Distance) .Take(k) .WithApproximate(), - fts => fts.Key, + fts => fts.Article.Id, vs => vs.Value.Id, (fts, vs) => new { - Article = vs.Value, - FullTextRank = fts.Rank, - VectorDistance = (double?)vs.Distance + Article = fts != null ? fts.Article : vs.Value, + FullTextRank = fts == null ? null : (int?)fts.Rank, + VectorDistance = vs == null ? null : (double?)vs.Distance }) // Apply Reciprocal Rank Fusion (RRF) to combine the results .Select(x => new { x.Article, - RrfScore = (1.0 / (k + x.FullTextRank)) + (1.0 / (k + x.VectorDistance) ?? 0.0) + RrfScore = (x.FullTextRank == null ? 0.0 : 1.0 / (k + x.FullTextRank.Value)) + + (x.VectorDistance == null ? 0.0 : 1.0 / (k + x.VectorDistance.Value)) }) .OrderByDescending(x => x.RrfScore) .Take(10) @@ -225,19 +231,17 @@ var results = await context.Articles This query: 1. Performs a full-text search on `Article` -2. Performs a vector search on `Article` and combines the results to the full-text search results via a LEFT JOIN +2. Performs a vector search on `Article` and combines the results with the full-text search results via a FULL JOIN 3. Calculates the RRF score by combining both the full text and the semantic ranking 4. Orders by RRF score, takes the desired number of results and projects out the original `Article` entities. -> [!NOTE] -> Rather than using a LEFT JOIN, a FULL OUTER JOIN would be more suitable for this scenario; this would allow highly-ranking results from either search side to be included in the final result, even if that result does not appear at all on the other side. With the above LEFT JOIN approach, if a result has a very high vector similarity score, it never gets included in the final result if that result doesn't also have a high full-text score. However, EF doesn't currently support FULL OUTER JOIN; upvote [#37633](https://github.com/dotnet/efcore/issues/37633) if this is something you'd like to see supported. - The query produces the following SQL: ```sql -SELECT TOP(@__p_4) [a0].[Id], [a0].[Content], [a0].[Title] +SELECT TOP(@__p_4) COALESCE([a].[Id], [t].[Id]) AS [Id], COALESCE([a].[Content], [t].[Content]) AS [Content], COALESCE([a].[Title], [t].[Title]) AS [Title] FROM FREETEXTTABLE([Articles], *, @__textualQuery_0, @__k_1) AS [f] -LEFT JOIN ( +INNER JOIN [Articles] AS [a] ON [f].[KEY] = [a].[Id] +FULL JOIN ( SELECT TOP(@__k_1) WITH APPROXIMATE [a].[Id], [a].[Content], [a].[Title], [v].[Distance] FROM VECTOR_SEARCH( TABLE = [Articles] AS [a], @@ -246,6 +250,6 @@ LEFT JOIN ( METRIC = 'cosine' ) AS [v] ORDER BY [v].[Distance] -) AS [t] ON [f].[KEY] = [t].[Id] -ORDER BY 1.0E0 / CAST(@__k_1 + [f].[RANK] AS float) + ISNULL(1.0E0 / (CAST(@__k_1 AS float) + [t].[Distance]), 0.0E0) DESC +) AS [t] ON [a].[Id] = [t].[Id] +ORDER BY ISNULL(1.0E0 / CAST(@__k_1 + [f].[RANK] AS float), 0.0E0) + ISNULL(1.0E0 / (CAST(@__k_1 AS float) + [t].[Distance]), 0.0E0) DESC ``` diff --git a/entity-framework/core/providers/sqlite/functions.md b/entity-framework/core/providers/sqlite/functions.md index bcc0c1e3a4..6725219b68 100644 --- a/entity-framework/core/providers/sqlite/functions.md +++ b/entity-framework/core/providers/sqlite/functions.md @@ -22,7 +22,9 @@ group.Min(x => x.Property) | MIN(Property) group.Sum(x => x.Property) | SUM(Property) group.Sum(x => x.DecimalProperty) | ef_sum(DecimalProperty) | EF Core 9.0 string.Concat(group.Select(x => x.Property)) | group_concat(Property, '') +string.Concat(group.OrderBy(x => x.Other).Select(x => x.Property)) | group_concat(Property, '' ORDER BY Other) | EF Core 11.0 string.Join(separator, group.Select(x => x.Property)) | group_concat(Property, @separator) +string.Join(separator, group.OrderBy(x => x.Other).Select(x => x.Property)) | group_concat(Property, @separator ORDER BY Other) | EF Core 11.0 ## Binary functions diff --git a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md index d47791ef7d..fb4fd80bca 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/breaking-changes.md @@ -2,7 +2,7 @@ title: Breaking changes in EF Core 11 (EF11) - EF Core description: List of breaking changes introduced in Entity Framework Core 11 (EF11) author: SamMonoRT -ms.date: 03/27/2026 +ms.date: 06/30/2026 uid: core/what-is-new/ef-core-11.0/breaking-changes --- @@ -30,6 +30,7 @@ This page documents API and behavior changes that have the potential to break ex | [EF tools packages no longer reference Microsoft.EntityFrameworkCore.Design](#ef-tools-no-design-dep) | Low | | [SqlVector properties are no longer loaded by default](#sqlvector-not-auto-loaded) | Low | | [Cosmos: empty owned collections now return an empty collection instead of null](#cosmos-empty-collections) | Low | +| [Owned JSON collections without an explicit key are obsolete](#owned-json-collections-obsolete) | Low | ## Medium-impact changes @@ -121,7 +122,6 @@ The previous escaping scheme was non-injective: the escape character `^` was nev If your application uses composite keys whose values can contain the characters `/`, `\`, `?`, or `#`, be aware of the following: - **Existing data**: Documents previously stored in Cosmos DB have `id` values using the old escape sequences (e.g. `Post|1|^2F`). After upgrading to EF Core 11, EF will generate unescaped `id` values (e.g. `Post|1|/`) and will no longer find those existing documents. To continue accessing existing data without migration, opt back into the old behavior using the `AppContext` switch described above—however, be aware that the id-collision bug will still be present. - - **New data**: If you are creating a new application or database, avoid using these illegal characters in key values, as they are not valid in Cosmos DB resource `id` values. See the [Azure documentation](xref:Microsoft.Azure.Documents.Resource.Id) for details. ## Low-impact changes @@ -321,6 +321,78 @@ if (entity.OwnedCollection is { Count: 0 }) } ``` + + +### Owned JSON collections without an explicit key are obsolete + +[Tracking Issue #37289](https://github.com/dotnet/efcore/issues/37289) + +#### Old behavior + +Previously, owned entity types mapped to a JSON column via could be used as collections without configuring an explicit primary key. EF Core would synthesize an ordinal (positional) key behind the scenes to identify each item in the collection: + +```csharp +public class Blog +{ + public int Id { get; set; } + public List Posts { get; set; } = new(); +} + +public class Post +{ + // No key property + public required string Title { get; set; } + public required string Content { get; set; } +} + +protected override void OnModelCreating(ModelBuilder modelBuilder) + => modelBuilder.Entity().OwnsMany(b => b.Posts, b => b.ToJson()); +``` + +#### New behavior + +Starting with EF Core 11.0, configuring an owned JSON collection without an explicit key produces an `OwnedEntityMappedToJsonCollectionWarning` warning. The mapping continues to work, but is now considered deprecated and is expected to be removed in a future release. + +Owned JSON entities that have an explicit primary key, as well as non-collection owned JSON references, are not affected by this change. + +#### Why + +[Complex types](xref:core/what-is-new/ef-core-10.0/whatsnew#complex-types) became fully supported in EF Core 10, including for [JSON mapping](xref:core/what-is-new/ef-core-10.0/whatsnew#json). Complex types are a better fit than owned types for JSON documents: they have value semantics and no identity, which avoids many of the issues that come from using owned entity types—which are entity types—to model what is fundamentally a value embedded in another document. In particular, owned JSON collections without an explicit key relied on a synthetic ordinal key, which has known limitations and corner cases. + +#### Mitigations + +The recommended mitigation is to migrate the type to a complex type, which is now the preferred way to map types to JSON: + +```csharp +protected override void OnModelCreating(ModelBuilder modelBuilder) + => modelBuilder.Entity().ComplexCollection(b => b.Posts, b => b.ToJson()); +``` + +Alternatively, if you need to keep the owned-type mapping, configure a non-shadow primary key on the owned type. Once a key is configured, the warning no longer applies: + +```csharp +public class Post +{ + public int Id { get; set; } + public required string Title { get; set; } + public required string Content { get; set; } +} + +protected override void OnModelCreating(ModelBuilder modelBuilder) + => modelBuilder.Entity().OwnsMany(b => b.Posts, b => + { + b.ToJson(); + b.HasKey(p => p.Id); + }); +``` + +If you cannot migrate immediately, you can suppress the warning via `ConfigureWarnings`: + +```csharp +protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + => optionsBuilder.ConfigureWarnings(w => w.Ignore(CoreEventId.OwnedEntityMappedToJsonCollectionWarning)); +``` + ## Microsoft.Data.Sqlite breaking changes @@ -334,6 +406,7 @@ if (entity.OwnedCollection is { Count: 0 }) |:----------------------------------------------------------------------------------------------------------|------------| | [Encryption-enabled SQLite packages have been removed](#sqlite-encryption-removed) | Medium | | [Some SQLitePCLRaw bundle packages have been removed](#sqlite-bundles-removed) | Medium | +| [Microsoft.Data.Sqlite now bundles SQLite3 Multiple Ciphers](#sqlite3mc) | Low | ### Medium-impact changes @@ -359,10 +432,10 @@ The previous no-cost `SQLitePCLRaw.bundle_e_sqlcipher` package was barely mainta If you need SQLite encryption, you have the following options: +- **SQLite3 Multiple Ciphers**: Starting with Microsoft.Data.Sqlite 11.0, the default SQLite build supports encryption and can be configured to use SQLCipher-compatible encryption. See [Microsoft.Data.Sqlite now bundles SQLite3 Multiple Ciphers](#sqlite3mc). NuGet packages are also available from [SQLite3MultipleCiphers-NuGet](https://github.com/utelle/SQLite3MultipleCiphers-NuGet). + - When encrypting a new database or opening an existing database that was encrypted with SQLCipher, you must configure the cipher scheme in the connection string using URI parameters—for example: `Data Source=file:example.db?cipher=sqlcipher&legacy=4;Password=`. See [How to open an existing database encrypted with SQLCipher](https://github.com/utelle/SQLite3MultipleCiphers-NuGet#how-to-open-an-existing-database-encrypted-with-sqlcipher) for details. - **SQLite Encryption Extension (SEE)**: This is the official encryption implementation from the SQLite team. A paid license is required. See [https://sqlite.org/com/see.html](https://sqlite.org/com/see.html) for details. NuGet packages are available through [SourceGear's SQLite build service](https://github.com/ericsink/SQLitePCL.raw/wiki/SQLite-encryption-options-for-use-with-SQLitePCLRaw). - **SQLCipher**: Purchase supported builds from [Zetetic](https://www.zetetic.net/sqlcipher/), or build the [open source code](https://github.com/sqlcipher/sqlcipher) yourself. -- **SQLite3 Multiple Ciphers**: NuGet packages are available from [SQLite3MultipleCiphers-NuGet](https://github.com/utelle/SQLite3MultipleCiphers-NuGet). - - When encrypting a new database or opening an existing database that was encrypted with SQLCipher, you must configure the cipher scheme in the connection string using URI parameters—for example: `Data Source=file:example.db?cipher=sqlcipher&legacy=4;Password=`. See [How to open an existing database encrypted with SQLCipher](https://github.com/utelle/SQLite3MultipleCiphers-NuGet#how-to-open-an-existing-database-encrypted-with-sqlcipher) for details. For more details, see [SQLite encryption options for use with SQLitePCLRaw](https://github.com/ericsink/SQLitePCL.raw/wiki/SQLite-encryption-options-for-use-with-SQLitePCLRaw) and [SQLitePCLRaw 3.0 Release Notes](https://github.com/ericsink/SQLitePCL.raw/blob/main/v3.md). @@ -378,7 +451,7 @@ Previously, the `SQLitePCLRaw.bundle_sqlite3`, `SQLitePCLRaw.bundle_winsqlite3`, ##### New behavior -Starting with SQLitePCLRaw 3.0 (used by Microsoft.Data.Sqlite 11.0), these bundle packages have been removed. If your application depended on one of these bundles, you must now reference the corresponding provider package and explicitly initialize it. +Starting with SQLitePCLRaw 3.0 (used by Microsoft.Data.Sqlite 11.0), these bundle packages have been removed. If your application depended on one of these bundles, use one of the following migration paths. ##### Why @@ -386,9 +459,7 @@ Each of these bundle packages contained only a single line of configuration code ##### Mitigations -Replace the removed bundle package with the corresponding provider package and add explicit initialization code. - -**If using `bundle_sqlite3` or `bundle_winsqlite3`**, replace the package reference: +**If using `bundle_sqlite3` or `bundle_winsqlite3`**, replace the removed bundle package with the corresponding provider package: ```xml @@ -418,6 +489,16 @@ static void Init() } ``` +**If using `bundle_e_sqlite3mc`**, replace the package reference with `SQLite3MC.PCLRaw.bundle`: + +```xml + + + + + +``` + **If using `bundle_green`**, the recommended migration path is to switch to `SQLitePCLRaw.bundle_e_sqlite3`. Alternatively, use `SQLitePCLRaw.config.e_sqlite3` paired with a separate native library package like `SourceGear.sqlite3`, which allows you to update the SQLite version independently: ```xml @@ -442,3 +523,80 @@ static void Init() > [!NOTE] > If you are using `SQLitePCLRaw.bundle_e_sqlite3`, no changes are required—just update the version number. See the [SQLitePCLRaw 3.0 Release Notes](https://github.com/ericsink/SQLitePCL.raw/blob/main/v3.md) for details. + +### Low-impact changes + + + +#### Microsoft.Data.Sqlite now bundles SQLite3 Multiple Ciphers + +[Tracking PR dotnet/efcore#38402](https://github.com/dotnet/efcore/pull/38402) + +##### Old behavior + +The `Microsoft.Data.Sqlite` package referenced `SQLitePCLRaw.bundle_e_sqlite3`, which provides the standard `e_sqlite3` native SQLite build. This build has no encryption support, so setting a password (for example, via `SqliteConnectionStringBuilder.Password` or the `Password` connection-string keyword) failed at runtime. + +##### New behavior + +Starting with `Microsoft.Data.Sqlite` 11.0, the package references `SQLite3MC.PCLRaw.bundle`, which provides the `e_sqlite3mc` native build ([SQLite3 Multiple Ciphers](https://github.com/utelle/SQLite3MultipleCiphers)). This build receives updates on NuGet.org more promptly than `SQLitePCLRaw.bundle_e_sqlite3`. + +As an added bonus, encryption (including setting a password) now works out of the box. See the [SQLite3 Multiple Ciphers documentation](https://github.com/utelle/SQLite3MultipleCiphers-NuGet#passphrase-based-database-encryption-support) for details on enabling passphrase-based database encryption. + +This change also applies to the EF Core SQLite provider (`Microsoft.EntityFrameworkCore.Sqlite`), which references `SQLite3MC.PCLRaw.bundle` through `Microsoft.Data.Sqlite`. + +##### Why + +The primary reason for the switch is maintenance and security: new versions of the `e_sqlite3` native build are no longer published to NuGet.org through `SQLitePCLRaw.bundle_e_sqlite3` in a timely manner, which means security fixes in upstream SQLite can be delayed. SQLite3 Multiple Ciphers is an actively maintained project that tracks upstream SQLite releases and ships updated builds promptly, so it was adopted as the default native build for `Microsoft.Data.Sqlite`. As an added bonus, it also supports encryption. This means it can replace the `SQLitePCLRaw.bundle_e_sqlcipher` package that was deprecated and removed (see [Encryption-enabled SQLite packages have been removed](#sqlite-encryption-removed)). + +##### Mitigations + +For most applications, **no action is required**. SQLite3 Multiple Ciphers is a superset of SQLite that behaves identically to the standard build for unencrypted databases—it only applies encryption when you explicitly supply a key or password. Existing unencrypted databases continue to open and work unchanged. + +Review the following cases, which may require action in some applications: + +- **Direct `SQLitePCLRaw.bundle_e_sqlite3` reference.** If your application directly references `SQLitePCLRaw.bundle_e_sqlite3`, it conflicts with the new `SQLite3MC.PCLRaw.bundle` dependency brought in by `Microsoft.Data.Sqlite` (or `Microsoft.EntityFrameworkCore.Sqlite`). Remove the direct `SQLitePCLRaw.bundle_e_sqlite3` reference unless you intentionally switch to the `.Core` packages shown below. + +- **Native library and provider name change.** The bundled native library is now `e_sqlite3mc` (rather than `e_sqlite3`), and the provider initialized by the bundle is `SQLite3Provider_e_sqlite3mc`. This matters if your application: + - References a specific native asset filename (for example, `e_sqlite3`) in publishing, trimming, AOT, or single-file configuration. Update those references to `e_sqlite3mc`. + +- **Platform (RID) coverage.** SQLite3 Multiple Ciphers doesn't currently include native binaries for every runtime identifier covered by `SourceGear.sqlite3`; for example, `linux-riscv64`, `linux-musl-riscv64`, and `linux-musl-s390x` aren't included. If you target a platform that the new bundle doesn't include, the native library may fail to load at runtime. In that case, revert to the standard build using the package references below. + +- **Linux glibc requirement and opt-out.** The bundled `e_sqlite3mc` library is prebuilt native code. On Linux, it currently requires glibc 2.33 or later; on older distributions, loading it can fail at runtime with an error such as `GLIBC_2.33 not found`. If the target system is unable to satisfy this requirement, follow the opt-out steps below. + +- **Reserved encryption keywords.** SQLite3 Multiple Ciphers reserves certain connection-string/URI parameters and PRAGMAs (such as `key`, `hexkey`, and `cipher`) for encryption configuration. This is unlikely to affect typical applications, but if you happened to use these names for unrelated purposes, behavior may differ. + +- **Double-quoted string literal support.** `e_sqlite3mc` doesn't include SQLite's legacy support for double-quoted string literals. If your SQL uses double quotes for string values, change it to use single quotes; double quotes should be used only for identifiers. Review raw SQL in your application (for example, SQL passed to `FromSql`, `ExecuteSql`, or migrations operations), and use SQL logging or integration tests to identify affected commands. + +If you want to keep using the standard, non-encrypted `e_sqlite3` build, reference `Microsoft.Data.Sqlite.Core` together with `SQLitePCLRaw.bundle_e_sqlite3` instead of the `Microsoft.Data.Sqlite` meta-package: + +```xml + + +``` + +For EF Core, reference `Microsoft.EntityFrameworkCore.Sqlite.Core` instead of `Microsoft.EntityFrameworkCore.Sqlite` and add the standard bundle: + +```xml + + +``` + +If you need to use a system-installed SQLite library instead of a bundled one, reference `Microsoft.Data.Sqlite.Core` together with `SQLitePCLRaw.provider.sqlite3` instead of the `Microsoft.Data.Sqlite` meta-package: + +```xml + + +``` + +For EF Core: + +```xml + + +``` + +And initialize the provider explicitly before using SQLite: + +```csharp +SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3()); +``` diff --git a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md index 5f48f20243..65e03a56f4 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/provider-facing-changes.md @@ -2,7 +2,7 @@ title: Provider-facing changes in EF Core 11 (EF11) - EF Core description: List of provider-facing changes introduced in Entity Framework Core 11 (EF11) author: SamMonoRT -ms.date: 04/08/2026 +ms.date: 06/22/2026 uid: core/what-is-new/ef-core-11.0/provider-facing-changes --- @@ -13,10 +13,13 @@ This page documents noteworthy changes in EF Core 11 which may affect EF provide ## Changes * Collation names are now quoted in SQL, like column and table names ([see #37462](https://github.com/dotnet/efcore/issues/37462)). If your database doesn't support collation name quoting, override `QuerySqlGenerator.VisitSql()` and `MigrationsSqlGenerator.ColumnDefinition()` to revert to the previous behavior, but it's recommended to implement some sort of restricted character validation. +* Type mapping has been made generic to support NativeAOT ([PR #38440](https://github.com/dotnet/efcore/pull/38440)). Provider maintainers should: (1) update custom mappings to derive from the new generic mapping base types (`CoreTypeMapping` and `RelationalTypeMapping` where applicable) so default comparers can be created without reflection, and (2) update calls/overrides of `CoreTypeMapping.Clone(...)` and `RelationalTypeMapping.Clone(...)` to remove the old `clrType` argument. * The `JsonPath` property on `IColumnModification` and `ColumnModificationParameters` has changed from `string?` to the new structured `JsonPath` type ([PR #38038](https://github.com/dotnet/efcore/pull/38038)). The `JsonPath` class provides `Segments`, `Ordinals`, an `IsRoot` property, and an `AppendTo(StringBuilder)` method for rendering the JSONPATH string. Providers that override `UpdateSqlGenerator.AppendUpdateColumnValue()` or otherwise handle JSON partial updates should update their code to use this new type. Where previously you checked for `null` or `"$"`, use `JsonPath is not { IsRoot: false }` instead, and call `JsonPath.AppendTo(stringBuilder)` to write the JSONPATH string representation. * EF Core now strips no-op SQL CASTs - i.e. `SqlUnaryExpression(Convert)` nodes whose store type matches that of their operand ([see #36247](https://github.com/dotnet/efcore/issues/36247), [PR #38156](https://github.com/dotnet/efcore/pull/38156)). This can flush out imprecise translations which assigned an imprecise store type to a node and then wrapped it with a Convert; because the store types now match, the Convert is stripped, and the imprecise store type may propagate. Review your translations to ensure that the operand of a Convert node has the correct, precise store type. +* Keys and indexes can now traverse complex-type properties ([PR #38192](https://github.com/dotnet/efcore/pull/38192)). The metadata API for indexes and keys has been broadened (e.g., `FindIndex`/`AddIndex` signatures now accept `IReadOnlyProperty`, new `ModelValidator` checks, and `ICSharpHelper` additions). Providers that consume index/key metadata, generate C# for indexes (scaffolding/codegen), or implement custom validation should review and update their code to handle complex-type-spanning keys and indexes. ## Test changes * The inheritance specification tests have been reorganized into a folder of their own ([PR](https://github.com/dotnet/efcore/pull/37410)). * Query test classes now support non-shared-model tests via a new `QueryFixtureBase` class that all query fixtures extend ([PR #37681](https://github.com/dotnet/efcore/pull/37681)). The previous pattern of extending `SharedStoreFixtureBase` and `IQueryFixtureBase` separately has been replaced. `NonSharedPrimitiveCollectionsQueryTestBase` has been merged into `PrimitiveCollectionsQueryTestBase`, and per-type array tests have been moved to `TypeTestBase.Primitive_collection_in_query`. +* EF Core's Specification.Tests assemblies have been upgraded from xUnit v2 to xUnit v3 ([PR #38277](https://github.com/dotnet/efcore/pull/38277)). Provider test projects that reference these assemblies and inherit from the base test classes must be migrated to xUnit v3: update to the new `xunit.v3` packages, `Microsoft.DotNet.XUnitV3Extensions`, `Microsoft.Testing.Platform` runner, and `Microsoft.NET.Test.Sdk`; account for `[Collection]`/`ITestOutputHelper` API differences; and change `[ConditionalFact]` to `[Fact]` and `[ConditionalTheory]` to `[Theory]`. When running tests directly with `dotnet exec`, add `--filter-not-trait category=failing --ignore-exit-code 8`. diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 64f8cd36a5..8aef322ac0 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -2,7 +2,7 @@ title: What's New in EF Core 11 description: Overview of new features in EF Core 11 author: SamMonoRT -ms.date: 04/22/2026 +ms.date: 06/10/2026 uid: core/what-is-new/ef-core-11.0/whatsnew --- @@ -106,6 +106,39 @@ modelBuilder.Entity() This simplifies model configuration by removing the need to explicitly navigate through intermediate complex type builders to reach the property you want to configure. + + +### Keys and indexes on complex type properties + +Keys and indexes can now use scalar properties nested inside non-collection complex types: + +```csharp +modelBuilder.Entity() + .HasKey(c => c.CustomerId.Value); + +modelBuilder.Entity() + .HasIndex(c => c.Address.PostalCode); +``` + +The same paths can be configured by name: + +```csharp +modelBuilder.Entity() + .HasIndex("Address.PostalCode"); +``` + +For relational providers, indexes can also target paths inside complex types mapped to JSON columns. Complex collection paths use `[]` for all elements or a numeric indexer for a specific element: + +```csharp +modelBuilder.Entity() + .ComplexCollection(o => o.Items, b => b.ToJson()); + +modelBuilder.Entity() + .HasIndex("Items[].Sku"); +``` + +For more information, see [Keys](xref:core/modeling/keys#keys-on-complex-type-properties) and [Indexes](xref:core/modeling/indexes#indexes-on-complex-type-properties). + ### Stabilization and bug fixes @@ -187,6 +220,30 @@ Both optimizations can have a significant positive impact on query performance, More details on the benchmark are available [here](https://github.com/dotnet/efcore/issues/29182#issuecomment-4231140289), and as always, actual performance in your application will vary based on your schema, data and a variety of other factors. + + +### Support for the new .NET 11 `FullJoin` operator + +.NET 11 adds first-class LINQ support for `FullJoin`, which keeps rows from both input collections and matches them when keys are equal. EF Core 11 translates this operator to `FULL JOIN` on relational databases: + +```csharp +var results = await context.Customers + .FullJoin( + context.Orders, + c => c.Id, + o => o.CustomerId, + (c, o) => new { Customer = c, Order = o }) + .ToListAsync(); +``` + +This generates SQL similar to the following: + +```sql +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] +``` + ### Stripping of no-op CASTs @@ -374,6 +431,47 @@ Both methods return `FullTextSearchResult`, giving you access to both t For more information, see the [full documentation on full-text search](xref:core/providers/sql-server/full-text-search). + + +#### Hybrid search + +SQL Server vector search can be combined with full-text table-valued functions to implement _hybrid search_: full-text search finds exact linguistic matches, vector search finds semantically similar results, and the two rankings are merged. EF Core 11's `FullJoin` support makes this pattern more complete, since highly-ranked rows from either side can contribute to the final results: + +```csharp +var results = await context.Articles + .FreeTextTable(textualQuery, topN: k) + .Join( + context.Articles, + fts => fts.Key, + a => a.Id, + (fts, a) => new { Article = a, fts.Rank }) + .FullJoin( + context.Articles.VectorSearch(a => a.Embedding, queryEmbedding, "cosine") + .OrderBy(r => r.Distance) + .Take(k) + .WithApproximate(), + fts => fts.Article.Id, + vs => vs.Value.Id, + (fts, vs) => new + { + Article = fts != null ? fts.Article : vs.Value, + FullTextRank = fts == null ? null : (int?)fts.Rank, + VectorDistance = vs == null ? null : (double?)vs.Distance + }) + .Select(x => new + { + x.Article, + RrfScore = (x.FullTextRank == null ? 0.0 : 1.0 / (k + x.FullTextRank.Value)) + + (x.VectorDistance == null ? 0.0 : 1.0 / (k + x.VectorDistance.Value)) + }) + .OrderByDescending(x => x.RrfScore) + .Take(10) + .Select(x => x.Article) + .ToListAsync(); +``` + +For more information, see the [SQL Server vector search documentation](xref:core/providers/sql-server/vector-search#hybrid-search). + ### Contains operations using JSON_CONTAINS @@ -444,6 +542,29 @@ WHERE JSON_CONTAINS([b].[JsonData], 8, N'$.Rating') = 1 For the full `JSON_CONTAINS` SQL Server documentation, see [`JSON_CONTAINS`](/sql/t-sql/functions/json-contains-transact-sql). + + +### JSON indexes + +EF Core 11 can create and scaffold [SQL Server JSON indexes](/sql/t-sql/statements/create-json-index-transact-sql) for paths inside complex types mapped to JSON columns: + +```csharp +modelBuilder.Entity() + .ComplexProperty(c => c.Contact, b => b.ToJson().HasColumnType("json")); + +modelBuilder.Entity() + .HasIndex("Contact.Address.City"); +``` + +This generates SQL similar to: + +```sql +CREATE JSON INDEX [IX_Customers_Contact_Address_City] +ON [Customers]([Contact]) FOR (N'$.Address.City'); +``` + +For more information, see [JSON indexes](xref:core/providers/sql-server/index#json-indexes). + ### Temporal period properties mapped to CLR properties @@ -504,6 +625,48 @@ For the complete list of date/time function translations, see the [SQL Server fu * now defaults to compatibility level 160 (SQL Server 2022), enabling SQL Server 2022-specific translations such as `LEAST` and `GREATEST` by default; see the [breaking change note](xref:core/what-is-new/ef-core-11.0/breaking-changes#sqlserver-compatibility-level-160) for more information. +## SQLite + + + +### Ordering in string aggregation + +EF Core can translate `string.Join` and `string.Concat` over a grouping to SQLite's `group_concat` aggregate function. Starting with EF 11, these translations also support ordering the aggregated values, by applying `OrderBy`/`OrderByDescending` inside the aggregate. Previously, queries that ordered the values fell back to client evaluation. + +For example, the following query concatenates each blog's post titles, ordered by descending post `Id`: + +```csharp +var blogs = await context.Blogs + .Select(b => new + { + b.Name, + Posts = string.Join( + ", ", + b.Posts.OrderByDescending(p => p.Id).Select(p => p.Title)) + }) + .ToListAsync(); +``` + +This translates to the following SQL, which uses `group_concat` with an `ORDER BY` clause: + +```sql +SELECT "b"."Name", COALESCE(group_concat("p"."Title", ', ' ORDER BY "p"."Id" DESC), '') AS "Posts" +FROM "Blogs" AS "b" +LEFT JOIN "Posts" AS "p" ON "b"."Id" = "p"."BlogId" +GROUP BY "b"."Id", "b"."Name" +``` + +Ordering inside `group_concat` requires SQLite 3.44.0 or later. + + + +### UInt128 support + +`Microsoft.Data.Sqlite` can now bind parameter values. The value is stored as a zero-padded, 39-digit text representation, which preserves correct ordering and comparison of values directly in the database. + +> [!NOTE] +> Reading values from data readers is not yet supported. + ## Cosmos DB @@ -538,6 +701,31 @@ Complex types are generally a better fit than owned types when mapping to JSON d This feature was contributed by [@JoasE](https://github.com/JoasE) - many thanks! + + +### Indexes and indexing policy + +EF Core 11 adds support for more Azure Cosmos DB indexing policy configuration. You can now disable automatic indexing, exclude individual paths when automatic indexing is enabled, and emit explicit single-property, composite, vector, and full-text indexes: + +```csharp +modelBuilder.Entity(b => +{ + b.HasAutomaticIndexing() + .Except("/InternalNotes/?"); + + b.HasIndex(o => new { o.CustomerId, o.OrderDate }); +}); +``` + +Indexes can also traverse complex type properties and complex collections: + +```csharp +modelBuilder.Entity() + .HasIndex(o => o.Items.Select(i => i.Sku)); +``` + +For more information, see [Indexing policy](xref:core/providers/cosmos/modeling#indexing-policy). + ### Transactional batches @@ -711,6 +899,23 @@ Explicit command-line options always take precedence over configuration file val For more information, see [Configuration file](xref:core/cli/dotnet#configuration-file). + + +### Wildcard context support for migration commands + +When a project defines multiple `DbContext` types, several `dotnet ef` commands accept a wildcard (`*`) as the value of the `--context` option to target all contexts at once, instead of running the command separately for each one. The commands that support the wildcard are: + +* `dotnet ef migrations list` — lists the migrations for every context. +* `dotnet ef migrations script` — generates and concatenates a script for every context. +* `dotnet ef database update` — applies migrations to the database of every context (migration bundles are covered as well). +* `dotnet ef database drop` — drops the database for every context. + +For example, the following command lists the migrations for all contexts in the project: + +```dotnetcli +dotnet ef migrations list --context "*" +``` + ## Other improvements * The EF command-line tool now writes all logging and status messages to standard error, reserving standard output only for the command's actual expected output. For example, when generating a migration SQL script with `dotnet ef migrations script`, only the SQL is written to standard output. From 945c97b1695414292d7cdc6cc244dea50cf8ac06 Mon Sep 17 00:00:00 2001 From: Ali Alo <72757701+ali-alo@users.noreply.github.com> Date: Mon, 13 Jul 2026 20:00:42 +0200 Subject: [PATCH 36/36] Update warning about split queries and ordering (#5420) --- entity-framework/core/querying/single-split-queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity-framework/core/querying/single-split-queries.md b/entity-framework/core/querying/single-split-queries.md index 37f98e7da9..96e6797eca 100644 --- a/entity-framework/core/querying/single-split-queries.md +++ b/entity-framework/core/querying/single-split-queries.md @@ -107,7 +107,7 @@ ORDER BY [b].[BlogId] ``` > [!WARNING] -> When using split queries with Skip/Take on EF versions prior to 10, pay special attention to making your query ordering fully unique; not doing so could cause incorrect data to be returned. For example, if results are ordered only by date, but there can be multiple results with the same date, then each one of the split queries could each get different results from the database. Ordering by both date and ID (or any other unique property or combination of properties) makes the ordering fully unique and avoids this problem. Note that relational databases do not apply any ordering by default, even on the primary key. +> When using split queries with Skip/Take on EF versions prior to 10, pay special attention to making your query ordering fully unique; not doing so could cause incorrect data to be returned. For example, if results are ordered only by date, but there can be multiple results with the same date, then each one of the split queries could get different results from the database. Ordering by both date and ID (or any other unique property or combination of properties) makes the ordering fully unique and avoids this problem. Note that relational databases do not apply any ordering by default, even on the primary key. > [!NOTE] > One-to-one related entities are always loaded via JOINs in the same query, as it has no performance impact.