You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,12 @@ This enhancement removes a significant limitation when modeling complex domain h
77
77
78
78
For more information on inheritance mapping strategies, see [Inheritance](xref:core/modeling/inheritance).
79
79
80
+
<aname="complex-types-cosmos"></a>
81
+
82
+
### Complex types in Azure Cosmos DB
83
+
84
+
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).
85
+
80
86
## LINQ and SQL translation
81
87
82
88
<aname="linq-maxby-minby"></a>
@@ -106,6 +112,38 @@ Similarly, `MinByAsync` orders ascending and returns the element with the minimu
106
112
107
113
## Cosmos DB
108
114
115
+
<aname="cosmos-complex-types"></a>
116
+
117
+
### Complex types
118
+
119
+
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.
120
+
121
+
For example, the following configures `ShippingAddress` as a complex type:
122
+
123
+
#### [Fluent API](#tab/fluent-api)
124
+
125
+
```csharp
126
+
modelBuilder.Entity<Order>()
127
+
.ComplexProperty(o=>o.ShippingAddress);
128
+
```
129
+
130
+
#### [Data Annotations](#tab/data-annotations)
131
+
132
+
```csharp
133
+
[ComplexType]
134
+
publicclassShippingAddress
135
+
{
136
+
publicrequiredstringStreet { get; set; }
137
+
publicrequiredstringCity { get; set; }
138
+
}
139
+
```
140
+
141
+
***
142
+
143
+
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.
144
+
145
+
This feature was contributed by [@JoasE](https://github.com/JoasE) - many thanks!
0 commit comments