Repository navigation
[8.0] Fix repeated seed-data updates for list properties - #4028
Merged
Merged
Conversation
Backport #4024. Reuse the collection value comparer for key comparisons and adapt its expressions to the collection CLR type using the EF 8 comparer APIs. Fixes #3635 (cherry picked from commit 8fd6510) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85e067fd-39b0-4a09-8247-395a5d886a3f
Backport the #4024 correction: build collection key comparers from element key comparers, preserving structural equality and hashing for binary array/list elements. (cherry picked from commit cd7d820) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85e067fd-39b0-4a09-8247-395a5d886a3f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #4024 to
hotfix/8.0.12, including the structural element-hashing correction from commitcd7d820f8efb20f7e14a469cb393f776afc51a4b.Supply an element-wise collection key comparer built from the element mapping's key comparer. This prevents redundant seed-data updates for unchanged lists while preserving updates for changed lists and arrays, and keeps equality and hashing consistent for binary collection keys.
EF 8 does not provide
ComposeConversion, so adapt the existing equality, hash-code, and snapshot expressions to the collection CLR type inline. The seed-data and binary-key regression coverage matches the source fix.Validation: reproduced the unchanged-list failure and both binary-key hash failures before their fixes. All four seed-data cases, both binary-key cases, and affected mapping/converter tests now pass (214 passed, 6 pre-existing skips), as do both array/list roundtrip tests, using the release branch's existing xUnit/VSTest runner.
Fixes #3635