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
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,29 @@ For more information on inheritance mapping strategies, see [Inheritance](xref:c
83
83
84
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
85
86
+
<aname="complex-types-property-chaining"></a>
87
+
88
+
### Configuring complex type properties via lambda chaining
89
+
90
+
Previously, configuring a property on a complex type required first calling `ComplexProperty` to get the complex type builder, and then calling `Property` on it:
91
+
92
+
```csharp
93
+
modelBuilder.Entity<MyEntity>()
94
+
.ComplexProperty(e=>e.Details)
95
+
.Property(d=>d.Description)
96
+
.HasMaxLength(500);
97
+
```
98
+
99
+
EF Core 11 now allows configuring complex type properties directly by chaining member access in the lambda expression passed to `Property`:
100
+
101
+
```csharp
102
+
modelBuilder.Entity<MyEntity>()
103
+
.Property(e=>e.Details.Description)
104
+
.HasMaxLength(500);
105
+
```
106
+
107
+
This simplifies model configuration by removing the need to explicitly navigate through intermediate complex type builders to reach the property you want to configure.
0 commit comments