Skip to content

Conversation

roji
Copy link
Member

@roji roji commented Sep 15, 2025

Fixes #36761

Description
As part of the considerable work that went into complex types in 10, complex property accesses in queries started getting systematically transformed into EF.Property, as (was) standard in the query pipeline. This causes query failure when an unmapped property access is composed on top.

Customer impact
Queries accessing unmapped properties via complex properties now fail:

var v = await context.Entities
    .Select(p => p.ComplexProperty.Unmapped)
    .ToListAsync();

How found
Customer reported.

Regression
Yes

Testing
Test added

Risk
Low, affects mainly new code introduced in EF 10, and in any case only complex type support, which was very limited before 10 and so doesn't risk breaking many people.

@roji roji requested a review from a team as a code owner September 15, 2025 09:49
@roji roji added the ask-mode label Sep 15, 2025
@cincuranet

This comment was marked as resolved.

@roji roji force-pushed the ComplexEfProperty branch from 3aee44f to 047037f Compare September 15, 2025 12:38
@roji roji force-pushed the ComplexEfProperty branch from 047037f to 83a0a11 Compare September 15, 2025 14:04
@roji

This comment was marked as resolved.

This comment was marked as resolved.

@alaatm

This comment was marked as resolved.

@roji

This comment was marked as resolved.

@roji roji requested review from artl93 and a team September 16, 2025 09:07
Copy link
Member

@artl93 artl93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RC2 - new in NET 10

@roji roji merged commit 38a40a6 into dotnet:release/10.0 Sep 17, 2025
7 checks passed
@roji roji deleted the ComplexEfProperty branch September 17, 2025 09:08
cincuranet added a commit that referenced this pull request Sep 17, 2025
* Update dependencies from https://github.com/dotnet/dotnet build 283422
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Helix.Sdk (Version 10.0.0-beta.25464.104 -> 10.0.0-beta.25466.101)
Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Abstractions, Microsoft.Extensions.Configuration.EnvironmentVariables, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.HostFactoryResolver.Sources, Microsoft.Extensions.Logging, Microsoft.NETCore.App.Ref, Microsoft.NETCore.Platforms, System.Formats.Asn1, System.Runtime.Caching, System.Text.Encodings.Web, System.Text.Json (Version 10.0.0-rc.2.25464.104 -> 10.0.0-rc.2.25466.101)

* [rc2] Fix race condition in SingletonCosmosClientWrapper.Client (#36767)

Fixes #36714

Co-authored-by: AndriySvyryd <[email protected]>

* Fix ExecuteUpdate parameters for multiple properties with same name (#36792)

And validate against null required properties in JSON serialization.

Fixes #36791

* Stop transforming complex property access to EF.Property (#36786)

Fixes #36761

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jiri Cincura ↹ <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: AndriySvyryd <[email protected]>
Co-authored-by: Shay Rojansky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Regression] Unmapped property access over complex types fails in EF 10 (EF.Property<T> method may only be used within Entity Framework LINQ queries)
4 participants