Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion entity-framework/core/providers/cosmos/modeling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: roji
ms.date: 09/26/2024
ms.date: 03/18/2026
Comment thread
roji marked this conversation as resolved.
Outdated
uid: core/providers/cosmos/modeling
---
# Configuring the model with the EF Core Azure Cosmos DB Provider
Expand Down
43 changes: 43 additions & 0 deletions entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ This enhancement removes a significant limitation when modeling complex domain h

For more information on inheritance mapping strategies, see [Inheritance](xref:core/modeling/inheritance).

<a name="complex-types-cosmos"></a>

### Complex types in Azure Cosmos DB

Complex types are now fully supported in the Azure Cosmos DB provider, embedded as nested JSON objects or arrays. For more information, [see the Cosmos DB section below](#cosmos-complex-types).

## LINQ and SQL translation

<a name="linq-maxby-minby"></a>
Expand Down Expand Up @@ -106,6 +112,43 @@ Similarly, `MinByAsync` orders ascending and returns the element with the minimu

## Cosmos DB

<a name="cosmos-complex-types"></a>

### Complex types

EF Core [complex types](xref:core/what-is-new/ef-core-10.0/whatsnew#complex-types) are now fully supported in the Azure Cosmos DB provider; they are embedded as nested JSON objects (or arrays, for collections) within the owning document, with support for queries, inserts, and updates.
Comment thread
roji marked this conversation as resolved.

For example, given the following model:

```csharp
public class Order
{
public int Id { get; set; }
public required ShippingAddress ShippingAddress { get; set; }
}

[ComplexType]
Comment thread
roji marked this conversation as resolved.
public class ShippingAddress
{
public required string Street { get; set; }
public required string City { get; set; }
}
```

EF will embed the `ShippingAddress` as a nested JSON object in the `Order` document:
Comment thread
roji marked this conversation as resolved.
Outdated

```json
{
"id": 1,
"ShippingAddress": {
"Street": "221 B Baker St",
"City": "London"
}
}
```

This feature was contributed by [@JoasE](https://github.com/JoasE) - many thanks!

<a name="cosmos-transactional-batches"></a>

### Transactional batches
Expand Down