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
How should one ignore properties in an owned type using fluent call? I have figured out how to do this with attributes by adding [NotMapped] to the property, but not how the same is done using Fluent API.
In EF 6 I was able to ignore properties on a complex type like this: modelBuilder.ComplexType<StreetAddress>().Ignore(a => a.City);
In EF Core 2.2, it is possible to define the type but not continue with Ignore: modelBuilder.Owned<StreetAddress>();
The by-design restrictions tell me I cannot do this: modelBuilder.Entity<StreetAddress>().Ignore(a => a.City);
I think it would be helpful with a section in the documentation of Owned Entity Types about ignoring properties in an owned type using both attributes and fluent API.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: d02e6748-42e0-000a-4945-42cd05a0b875
Version Independent ID: e3effbd0-07f2-423d-4032-1722e75adb37
How should one ignore properties in an owned type using fluent call? I have figured out how to do this with attributes by adding
[NotMapped]
to the property, but not how the same is done using Fluent API.In EF 6 I was able to ignore properties on a complex type like this:
modelBuilder.ComplexType<StreetAddress>().Ignore(a => a.City);
In EF Core 2.2, it is possible to define the type but not continue with Ignore:
modelBuilder.Owned<StreetAddress>();
The by-design restrictions tell me I cannot do this:
modelBuilder.Entity<StreetAddress>().Ignore(a => a.City);
I think it would be helpful with a section in the documentation of Owned Entity Types about ignoring properties in an owned type using both attributes and fluent API.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: