Let's say I have a parent class with 2 sub-classes, with the following configuration:
modelBuilder.Entity<ParentType>(entity =>
{
entity.HasDiscriminator()
.HasValue<ChildA>("ChildA")
.HasValue<ChildB>("ChildB");
}
So how do I pull the data based on the child type?
var result = context.ParentTypes.
.Where(x => ...);
In the table, I see a column called Discriminator
with values, such as ChildA
and ChildB
. However, there's no such property on x.Discriminator
.