WebApi
WebApi copied to clipboard
EF Core & OData & TPH
Hi,
We have a dotnet core 3 project running with EF core 3.1.10 and we are running into an issue. We have multiple courtcasestatuses called "absent", "delayed" and so on. They all have their own class inheriting from courtcasestatus.
In EF core 3 the only option to map this to a database is TPH (https://docs.microsoft.com/en-us/ef/core/modeling/inheritance). Now this is working BUT for 1 type we have a reference to another table. Meaning in this example that the type "delayed" can have calendaritems. This is all working fine but we are unable to retrieve those calendaritems through OData. If we put the calendaritems on the basetype than it works but this is not matching our model as type "absent" should not have calender items.
How can we retrieve those calendar items belonging to the statuscasetype "delayed" with odata 7.5.2?
Thank you,
Jordi
Can you please share the model. Meanwhile you can try using the expand like $expand=namespace.delayed/calendaritems
@marshal1501 Was this issue resolved?
Closing this issue due to inactivity. If this issue still persists, feel free to create a new issue.