-
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
Add metadata support for TPC #27628
Add metadata support for TPC #27628
Conversation
/// </summary> | ||
/// <param name="entityType">The entity type.</param> | ||
/// <returns>The mapping strategy for the derived types.</returns> | ||
public static string? GetMappingStrategy(this IReadOnlyEntityType entityType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a mapping strategy be applied to the entire model rather than to each entity type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet. #27642
Part of #3170
What would happen in scenario when user configures discriminator and also applies TPT/TPC mapping strategy explicitly? Refers to: src/EFCore.Relational/Metadata/Conventions/EntityTypeHierarchyMappingConvention.cs:110 in db75fae. [](commit_id = db75fae, deletion_comment = False) |
{ | ||
var columnName = property.GetColumnBaseName(); | ||
if (columnName == null) | ||
var mappedTableName = isTph ? entityType.GetRootType().Name : mappedType.Name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would have loved if the variable didn't use table in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, me too...
We throw |
Part of #3170
UseTpcMappingStrategy
andUseTptMappingStrategy
, calling either maps all derived to different tables/viewsToTable
on a non-root type maps the hierarchy using TPTToTable
on abstract entity type if TPC