Skip to content

Nested Owned Types with Custom Column Names not Populating Properties #33314

@tjHol888

Description

@tjHol888

The bug is virtually identical to #16032 however in my case I have also customized my column names off of the OwnedEntity_NestedOwnedEntity_Property default naming convention. I can configure my nested owned types columns like below

builder.OwnsOne(ent => ent.SubEnt).OwnsOne(subEnt => subEnt.Prop, acc => {
acc.Property(c => c.Id).HasColumnName($"Something");
});

The above configuration works wonderfully for building the underlying sql query and is in fact looking for the right columns. When I run the query manually I see valid values it SHOULD be setting but it is not. It is only when I update all the columns back to the default naming convention and remove the above column name customization will it, with the exact same data, populate the nested owned type properties.

Note: It is not that the nested owned type is null, as many other threads are, it is an instance but all properties are the default values instead of being set properly.

Include provider and version information

EF Core version: 6.0.7
Database provider: SqlServer
Target framework: (e.g. .NET 6.0)
Operating system:
IDE: (e.g. Visual Studio 2022 17.4)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions