-
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
Query: Implement TPT for relational layer #21474
Conversation
test/EFCore.SqlServer.FunctionalTests/Query/TPTInheritanceQuerySqlServerTest.cs
Show resolved
Hide resolved
src/EFCore.Relational/Query/RelationalEntityShaperExpression.cs
Outdated
Show resolved
Hide resolved
test/EFCore.SqlServer.FunctionalTests/Query/TPTInheritanceQuerySqlServerTest.cs
Show resolved
Hide resolved
Looking good so far |
Updated to expand owned navigations on TPT. |
0327d4d
to
169e353
Compare
Updated to handle table splitting & TPT.
|
Why not separate commits? 😭 |
src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs
Show resolved
Hide resolved
src/EFCore.Relational/Query/RelationalQueryableMethodTranslatingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
592f9c5
to
3a3221b
Compare
Did you make a mistake with the commits again? |
I had to rebase to pick up test infra changes from @maumar - There is another set of test changes coming for TPTRelationships tests. |
You can rebase without squashing |
property.GetTableColumnMappings().Cast<IColumnMappingBase>().Concat(property.GetViewColumnMappings()) | ||
.FirstOrDefault()?.Column.Name // TODO: this should take table into account | ||
?? property.GetColumnName(), | ||
column?.Name ?? property.GetColumnName(), |
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.
If you are going to keep GetColumnName()
you might need to add code for views
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.
What should be used here?
There should always be column passed if there is mapping. GetColumnName is only used in scenario when there is no mapping.
Related: What should be the mappings used for FromSql
& TVF methods (not the query root mapped to the function)?
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.
FromSql should use the same mapping as a normal query. Method TVF mappings are also returned by GetFunctionMappings
, but with IsDefaultFunctionMapping
set to false.
Would there be any other situations where column is null?
Btw, you don't need to fix this in this PR
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.
Filed #21511
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.
You you should do it in #21507 😄
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.
I would but I would like to understand more about which column mappings to use when no table(base)mappings are used from entity type. It also has overlap with #21508
Hello @smitpatel! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Resolves #2266