You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Annotations for basetype properties should be added to both derived types.
Actual result
Annotations for basetype properties are only added to the last type added.
Additional detail
Stepping through the code shows that EdmTypeMap.EdmProperties has only 1 PropertyInfo item while in .Net 6 there are 2.
I have found 2 workarounds, either:
Add basetype: builder.EntityType<BaseEntity>();
Change baseclass to an interface
The text was updated successfully, but these errors were encountered:
jr01
changed the title
Annotations for basetype properties in .Net 7 only added to last type added
Annotations for basetype properties only added to last type added in .Net 7
Nov 15, 2022
In .Net 7 annotations for basetype properties are only added to the last type.
Assemblies affected
Microsoft.OData.ModelBuilder 1.0.9
Reproduce steps
This program throws
InvalidOperationException
, while it runs fine when TargetFramework isnet6.0
.ConsoleApp.csproj
Program.cs
Expected result
Annotations for basetype properties should be added to both derived types.
Actual result
Annotations for basetype properties are only added to the last type added.
Additional detail
Stepping through the code shows that
EdmTypeMap.EdmProperties
has only 1PropertyInfo
item while in .Net 6 there are 2.I have found 2 workarounds, either:
builder.EntityType<BaseEntity>();
The text was updated successfully, but these errors were encountered: