Repository navigation
[9.0] Fix collection conversion with nullable element converters (#3965) - #3968
Merged
Merged
Conversation
Backport d33cdd4 to hotfix/9.0.5. Adapt element conversion input and output nullability while preserving existing null guards, with array/list round-trip coverage. The inherited nullable-comparer functional test from the original change is not available on this release branch. Co-authored-by: Copilot App <[email protected]> Copilot-Session: b08c8c16-d069-4af1-a1b5-735487e9680b
This was referenced Oct 16, 2026
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 #3965 (d33cdd4) to
hotfix/9.0.5, addressing the converter failure reported in #3919.Adapt the element conversion lambda's input and output nullability to the collection element types while preserving existing null guards. Include the original array/list round-trip regression tests.
The inherited nullable-comparer query test from the original PR does not exist in EF Core 9, so that inapplicable override is omitted. No other release-specific code adaptations.
Validation: both new regression tests failed before the fix; all 6 converter unit tests and 54 focused array/list conversion and primitive-collection
Containsfunctional tests passed afterward using .NET SDK 9.0.312 and local PostgreSQL.Limitation: The exact #3919 query (
int[]parameter withnumbers.Contains(x.Num.Value)and the nullableint?-to-string converter) still fails duringToQueryString()on 9.0 after this fix. It gets past element conversion, then hits a separate collection-comparerInvalidOperationException: EF cannot coerceValueComparer<int?>toValueComparer<int>while constructingListOfValueTypesComparer. This backport leaves that separate issue unchanged.