Open samisq opened 8 months ago
Note for team triage: also repros on SQL Server and still repros on latest daily.
@maumar Still repros on latest daily.
when building SelectExpression
from TableValuedFunctionExpression
we put StoreFunction as ITableBase (and put it in table map).
Later, in the ApplyProjection step when we try to build shaper expression for the complex type, we rely on GetViewOrTableMappings
from metadata, to find the table, and that resolves to a BlogMetadata table, which is not what we expect.
I can get the right table mapping by doing
complexProperty.ComplexType.ContainingEntityType.GetFunctionMappings().Single().Table;
but then the code blows up later when trying to find a column associated with a property on a complex type (FunctionColumnMappings got nothing in them)
Blocked by/duplicate of https://github.com/dotnet/efcore/issues/34627
Runnable project: ComplexPropertyBug.zip
Code snippet
The following exception is thrown when running the attached code project:
Note: similar issue happens when using views, but the exception is slightly different in that case:
Provider and version information
EF Core version: 8.0.2 Database provider: Npgsql.EntityFrameworkCore.PostgreSQL Target framework: .NET 8.0 Operating system: Mac OS