Query: In TPH inheritance, int discriminator does not work, exception is thrown when compiling query #7359
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
In TPH inheritance, string discriminator works, but int discriminator does not work.
When querying SupplierTansactions table, EF Core throws InvalidOperationException when compiling the query:
The reason is, in RelationalQueryModelVisitor.TypeIsExpressionTranslatingVisitor.VisitTypeBinary method:
The discriminator property PaymentMethodID becomes an int? property, but the discriminator value is still int value as specified. So the Expression.Equal call throws the above exception.
Any workaround for int discriminator in TPH?
The text was updated successfully, but these errors were encountered: