Skip to content
Open
Changes from all 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
38 changes: 38 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,38 @@ 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.

For example, the following configures `ShippingAddress` as a complex type:

#### [Fluent API](#tab/fluent-api)

```csharp
modelBuilder.Entity<Order>()
.ComplexProperty(o => o.ShippingAddress);
```

#### [Data Annotations](#tab/data-annotations)

```csharp
[ComplexType]
public class ShippingAddress
{
public required string Street { get; set; }
public required string City { get; set; }
}
```

***

Complex types are generally a better fit than owned types when mapping to JSON documents: unlike owned types, complex types have value semantics and no identity, which means they work better in scenarios such as comparing two embedded objects within the same document.

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

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

### Transactional batches
Expand Down
Loading