Open joakimriedel opened 2 years ago
Blocked on https://github.com/dotnet/efcore/issues/16298
For fix of this particular issue in Nav expansion, pass in the set operation type to the method. Currently we infer type from outer or inner based on what is assignable to what. Though for mismatching types, that is incorrect. In above query we remove Cast to Animal since it is converting to base type and redundant (except for set operation case). We need to preserve that set operation is on Animal rather than Cat/Dog.
I would expect the following code to work, but it throws an exception.
See the following gist for full repro.
Also tried the following, but it does client eval and throws
This is a workaround, but I'd prefer using
OfType
if possible somehow?The resulting SQL query from workaround is the following, which I would have expected also from using
OfType
.Include stack traces
Include provider and version information
EF Core version: 6.0.3 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .net 6 Operating system: Win11 IDE: VS Code