From cbd78fd2fbf5e226e7489d09595307439c6b1d51 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 30 Apr 2026 12:50:57 +0200 Subject: [PATCH] Document complex type property configuration via lambda chaining Add what's new section for dotnet/efcore#31236, showing how EF Core 11 allows configuring complex type properties directly via chained member access (e.g. e => e.Details.Description) instead of requiring explicit ComplexProperty().Property() calls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../core/what-is-new/ef-core-11.0/whatsnew.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md index 2bd1d5410e..42f42c3c5d 100644 --- a/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md +++ b/entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md @@ -83,6 +83,29 @@ For more information on inheritance mapping strategies, see [Inheritance](xref:c 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). + + +### Configuring complex type properties via lambda chaining + +Previously, configuring a property on a complex type required first calling `ComplexProperty` to get the complex type builder, and then calling `Property` on it: + +```csharp +modelBuilder.Entity() + .ComplexProperty(e => e.Details) + .Property(d => d.Description) + .HasMaxLength(500); +``` + +EF Core 11 now allows configuring complex type properties directly by chaining member access in the lambda expression passed to `Property`: + +```csharp +modelBuilder.Entity() + .Property(e => e.Details.Description) + .HasMaxLength(500); +``` + +This simplifies model configuration by removing the need to explicitly navigate through intermediate complex type builders to reach the property you want to configure. + ### Stabilization and bug fixes