-
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
Allow mapping different entity types in a hierarchy to different store constructs (table/view/procedure/etc.) #27192
Comments
@cjalex1313 Yes. What did you try and it what way did it fail? |
I just tried again in an example web api proj. Database structure: CREATE VIEW Dog as CREATE VIEW Cat as DTO Classes
EF Context
By querying anything from the context I'm getting a error message of this type: System.InvalidOperationException: Both 'Cat' and 'Animal' are mapped to the table 'Animal'. All the entity types in a hierarchy that don't have a discriminator must be mapped to different tables. See https://go.microsoft.com/fwlink/?linkid=2130430 for more information. |
You are mapping Animal to table and derived types to view. Either map all of them to view or all of them to table. |
Ok.. well, that's not an option for me unfortunately |
In anycase thanks for the info. Much appreciated |
You can map all types using Alternatively, calling |
TPT inheritance with views:
Pretty plain question, I didn't find documentation about this nor did what I tried work.
The text was updated successfully, but these errors were encountered: