Fix false-positive duplicate detection in mapping deep member paths to TVP columns #488
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR deals with mapping deep member paths to table-valued parameter columns. Suppose a custom column mapper creates the following mappings:
A_X
A.X
B_X
B.X
The column-mapping code attempts to deduplicate mappings by keeping a
HashSet
of used members. When the code finds a member in theHashSet
, the code knows that a mapping used the member already. The code then avoids another mapping to the member.The key for duplicate detection is the
ClassPropInfo
of the final member in the member path. This causes false-positive duplicate detection in several scenarios, including:TVP with multiple children of the same type
TVP with multiple children of different types that each inherit a property from the same base class
This PR supports such scenarios by changing the duplicate detection key to the member path itself.
Checklist
Please make sure your pull request fulfills the following requirements:
- As far as I know, no documentation needs to be changed.
Type
This pull request includes what type of changes?
Breaking Changes
Does this pull request introduce any breaking changes?
This change causes parameter data to flow to TVP columns where it previously has not.
Any other comment
(n/a)