Using a Discriminator that is part of a composite key #18126
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
type-bug
Milestone
Using EF Core 3.0 release. If we have an abstract base class of Animal and two empty dervied classes of Dog and Cat
And a defined database context of
With Primary Key (Name, TypeOfAnimal) attempting to use TypeOfAnimal as a discriminator does not work correctly.
The discriminator value is not populated automatically and .Parent is not resolved to the derived type but to the base type (lets presume that parent of a cat can be a dog).
Adding a supplementary TypeOfAnimal2 : String, not attached to any key, then discriminating on that works both on the fetched Animal and .Parent reference as expected.
Is this a design limitation or a bug?
The text was updated successfully, but these errors were encountered: