-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HasDiscriminator based on owned value object property #29659
Comments
This is covered by #10140. Make sure to vote (👍) for that issue. |
@ajcvickers thank you for your response. What I understand from that issue is that it currently isn't possible to select all the types based on the base class as the base class itself is also considered one of the types instead of all/any of the types and if not mapped it will cause all the types to be filtered out and get an empty result. Is my understanding correct? This does indeed pose a problem for what I'm looking for. In my case I have a parent with many children. The navigation property is of generic type base class. And I expected all the child sub types to be included in the navigation property when the parent is queried. Then the parent class can either decide what to do based on the discriminator property or using pattern matching to gain access to a specific type. So I'll have to abandon my quest for this solution. However, when #10140 is solved, I still can't select a property from a value object as discriminator. Is there an issue which covers this scenario? Or will I have to issue this request seperately myself? |
@ajcvickers okay, thank you for expanding. I have voted it up. Would be great to have such feature added. |
Question
How would I go about configuring a discriminator column based on a property of an owned (OwnsOne) type?
Code
Stack trace
Provider and version information
EF Core version: 6.0.4
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Windows 11
IDE: Visual Studio 2022 17.4.1
The text was updated successfully, but these errors were encountered: