Skip to content
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

Create table mappings for complex types in TPC #35314

Draft
wants to merge 1 commit into
base: release/9.0-staging
Choose a base branch
from

Conversation

AndriySvyryd
Copy link
Member

Fixes #35025

Comment on lines +2661 to +2662
var complexTypeTable = complexProperty.ComplexType.GetViewOrTableMappings().SingleOrDefault(
ctm => containerProjection.TableMap.ContainsKey(ctm.Table))?.Table;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roji There can now be more than one mapping per complex type when all types in TPC hierarchy are selected. I think this code needs significant updates to support this. Do you see a simple/safe way to make it work for 9.0.x?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, makes sense... I'd have to look deeper, but is PR as-is sufficient to make it work? If so it doesn't necessarily seem to bad for a patch?

BTW if things do get complicated here and we only fix this for 10 (as part of the big complex type push), I don't think it's the end of the world either...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, makes sense... I'd have to look deeper, but is PR as-is sufficient to make it work? If so it doesn't necessarily seem to bad for a patch?

This PR changes the exception from "no elements" to "more than one element"


[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual async Task Select_base_with_ComplexTypes_in_TPC(bool async)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's AdHocComplexTypeQueryTestBase which is a bit more targeted... In any case, hopefully as we refactor our tests this wouldn't have to be ad-hoc any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants