Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f196150
Document EF Core 11 FullJoin support (#5374)
roji Jun 3, 2026
c742ccc
Document EF Core 11 indexing enhancements (#5380)
Copilot Jun 10, 2026
ccd214e
Document runtime migration creation (`--add` option for `database upd…
Copilot Jun 11, 2026
2298451
Document obsoletion of owned JSON collections without an explicit key…
Copilot Jun 11, 2026
056e4e6
Add docs for the remaining preview 6 features (#5382)
Copilot Jun 11, 2026
ebc3911
Document Cosmos discriminator naming breaking change (EF Core 11) (#5…
Copilot Jun 24, 2026
92a1a79
Fix link. (#5393)
cincuranet Jun 24, 2026
33cef58
Add EF11 breaking change note: `Property` no longer configures primit…
Copilot Jun 29, 2026
34efc7d
Document Microsoft.Data.Sqlite .NET Framework support removal in EF C…
Copilot Jul 7, 2026
033a6bd
Initial plan
Copilot Jul 14, 2026
0b2318f
Merge branch 'preview.7' into copilot/merge-main-to-preview-7
Copilot Jul 14, 2026
48d63df
Merge main to preview.7 (#5424)
AndriySvyryd Jul 14, 2026
43f38e1
Revert EF11 SQLite breaking changes for bundle_e_sqlite3 2.1.12 (#5425)
Copilot Jul 17, 2026
972e4ef
Document breaking change: Cosmos undefined projections now throw (EF …
Copilot Jul 30, 2026
5e7d3e3
Document -NoBuild switch for PMC Update-Database and Add-Migration (#…
Copilot Jul 30, 2026
6e876bb
Document DbQueryConcurrencyException breaking change for split querie…
Copilot Jul 30, 2026
a1725ce
Document Cosmos JSON breaking changes for EF Core 11 (#5432)
Copilot Jul 30, 2026
807ab1d
Apply suggestions from code review
AndriySvyryd Aug 3, 2026
b59a698
Order breaking change summary by impact
Copilot Aug 3, 2026
83d7b7b
Update EF Core preview documentation metadata
Copilot Aug 3, 2026
79e194b
Document GroupBy query enhancements
Copilot Aug 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions entity-framework/core/cli/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: EF Core tools reference (Package Manager Console) - EF Core
description: Reference guide for the Entity Framework Core Visual Studio Package Manager Console
author: SamMonoRT
ms.date: 11/08/2024
ms.date: 08/03/2026
uid: core/cli/powershell
ms.custom: sfi-ropc-nochange
---
Expand Down Expand Up @@ -122,8 +122,9 @@ Parameters:
| Parameter | Description |
|:-----------------------------------|:------------------------------------------------------------------------------------------------------------------------|
| <nobr>`-Name <String>`</nobr> | The name of the migration. This is a positional parameter and is required. |
| <nobr>`-OutputDir <String>`</nobr> | The directory use to output the files. Paths are relative to the target project directory. Defaults to "Migrations". |
| <nobr>`-OutputDir <String>`</nobr> | The directory to use for the output files. Paths are relative to the target project directory. Defaults to "Migrations". |
Comment thread
AndriySvyryd marked this conversation as resolved.
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for the generated classes. Defaults to generated from the output directory. |
| <nobr>`-NoBuild`</nobr> | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. |

The [common parameters](#common-parameters) are listed above.

Expand Down Expand Up @@ -319,6 +320,7 @@ Updates the database to the last migration or to a specified migration.
| <nobr>`-Add`</nobr> | 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. |
| <nobr>`-OutputDir <String>`</nobr> | The directory to put migration files in. Paths are relative to the target project directory. Requires `-Add`. Added in EF Core 11. |
| <nobr>`-Namespace <String>`</nobr> | The namespace to use for the generated migration classes. Requires `-Add`. Added in EF Core 11. |
| <nobr>`-NoBuild`</nobr> | Don't build the project before running the command. Intended to be used when the build is up-to-date. Added in EF Core 11. |

The [common parameters](#common-parameters) are listed above.

Expand Down
47 changes: 46 additions & 1 deletion entity-framework/core/providers/cosmos/querying.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Querying - Azure Cosmos DB Provider - EF Core
description: Querying with the Azure Cosmos DB EF Core Provider
author: SamMonoRT
ms.date: 09/19/2024
ms.date: 08/03/2026
uid: core/providers/cosmos/querying
---
# Querying with the EF Core Azure Cosmos DB Provider
Expand Down Expand Up @@ -213,6 +213,51 @@ Note that <xref:Microsoft.EntityFrameworkCore.CosmosQueryableExtensions.FromSql*

For more information on SQL querying, see the [relational documentation on SQL queries](xref:core/querying/sql-queries); most of that content is relevant for the Azure Cosmos DB provider as well.

## Undefined values in projections
Comment thread
AndriySvyryd marked this conversation as resolved.

In Azure Cosmos DB, a document property can be `undefined` — this happens when the property is simply not present in the JSON document. This can occur when navigating through an optional relationship that is absent for some documents, or when a property was added to the model after existing documents were written.

Starting with EF Core 11, when any part of an anonymous type or DTO projection evaluates to `undefined`, an `InvalidOperationException` is thrown with the message "A part of the projection was undefined, use the coalesce operator to handle possible undefined values." See the [breaking changes documentation](xref:core/what-is-new/ef-core-11.0/breaking-changes#cosmos-undefined-projection) for details on upgrading from EF Core 10 and earlier.

To handle undefined values in projections, use <xref:Microsoft.EntityFrameworkCore.CosmosDbFunctionsExtensions.IsDefined*> to filter out documents where a value is missing:

```csharp
var results = await context.Entities
.Where(x => EF.Functions.IsDefined(x.Associate!.NestedAssociate!.Id))
.Select(x => new { x.Associate!.NestedAssociate!.Id })
.ToListAsync();
```

Alternatively, use <xref:Microsoft.EntityFrameworkCore.CosmosDbFunctionsExtensions.CoalesceUndefined*> to substitute a default value for any property that could be `undefined`:

```csharp
var results = await context.Entities
.Select(x => new { Id = EF.Functions.CoalesceUndefined(x.Associate!.NestedAssociate!.Id, Guid.Empty) })
.ToListAsync();
```

### Naked projections and SELECT VALUE

A _naked projection_ — where a single value is projected directly without wrapping it in a DTO or anonymous type — is translated using `SELECT VALUE` in Cosmos DB SQL. As a result, any documents where the projected value is `undefined` are **silently skipped** and not included in the results:

```csharp
// Naked projection - translated as SELECT VALUE, undefined results are silently omitted
var ids = await context.Entities
.Select(x => x.Associate!.NestedAssociate!.Id)
.ToListAsync();
```

In contrast, any top-level instantiation in the projection (anonymous type, DTO, entity, or complex type) does **not** use `SELECT VALUE`. When a part of such a projection is `undefined`, an `InvalidOperationException` is thrown as described above.

If silently skipping undefined results is not the desired behavior, wrap the projected value in an anonymous type or DTO to get a consistent error instead:

```csharp
// Wrapped in an anonymous type - does not use SELECT VALUE, throws if undefined
var results = await context.Entities
.Select(x => new { x.Associate!.NestedAssociate!.Id })
.ToListAsync();
```

## Function mappings

This section shows which .NET methods and members are translated into which SQL functions when querying with the Azure Cosmos DB provider.
Expand Down
12 changes: 6 additions & 6 deletions entity-framework/core/providers/cosmos/unstructured-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Azure Cosmos DB Provider - Working with Unstructured Data - EF Core
description: How to work with Azure Cosmos DB unstructured data using Entity Framework Core
author: AndriySvyryd
ms.date: 11/05/2019
ms.date: 08/03/2026
uid: core/providers/cosmos/unstructured-data
---
# Working with Unstructured Data in EF Core Azure Cosmos DB Provider
Expand All @@ -11,7 +11,10 @@ EF Core was designed to make it easy to work with data that follows a schema def

## Accessing the raw JSON

It is possible to access the properties that are not tracked by EF Core through a special property in [shadow-state](xref:core/modeling/shadow-properties) named `"__jObject"` that contains a `JObject` representing the data received from the store and data that will be stored:
> [!NOTE]
> The `"__jObject"` shadow property was removed in EF Core 11. See [Breaking changes in EF Core 11](xref:core/what-is-new/ef-core-11.0/breaking-changes#cosmos-jObject-removed) for details.

In EF Core 10 and earlier, it was possible to access properties not tracked by EF Core through a special property in [shadow-state](xref:core/modeling/shadow-properties) named `"__jObject"` that contained a `JObject` representing the data received from the store and data that will be stored:

[!code-csharp[Unmapped](../../../../samples/core/Cosmos/UnstructuredData/Sample.cs?highlight=21,22&name=Unmapped)]

Expand All @@ -35,10 +38,7 @@ It is possible to access the properties that are not tracked by EF Core through
```

> [!WARNING]
> The `"__jObject"` property is part of the EF Core infrastructure and should only be used as a last resort as it is likely to have different behavior in future releases.

> [!NOTE]
> Changes to the entity will override the values stored in `"__jObject"` during `SaveChanges`.
> The `"__jObject"` property was part of the EF Core infrastructure. It exists only in EF Core 10 and earlier, and has been removed starting with EF Core 11.

## Using CosmosClient

Expand Down
Loading
Loading