InvalidOperationException when mapping properties of different types to the same column #29859
Labels
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
Milestone
Class A: BaseClass
[Column(nameof(Configuration), TypeName = "jsonb")]
public ConfigurationForClassA Configuration { get; set; } = new();
Class B: BaseClass
[Column(nameof(Configuration), TypeName = "jsonb")]
public ConfigurationForClassB Configuration { get; set; } = new();
This worked in .NET 5&6 (with Ef Core 5/6) by re-using the column in the baseclass table. Breaks after upgrading to .NET 7 and EF7.
are both mapped to column 'Configuration' in 'BaseClassTable', but are configured to use differing provider types
I would assume that there is some conflict with the new json support in EF7, maybe there is some requirement to mark classes used in json columns in some way? e.g. with an [Owned] attribute?
Originally reported by @cm-andrews at npgsql/efcore.pg#2595
The text was updated successfully, but these errors were encountered: