Repository navigation
[8.0] Fix collection conversion with nullable element converters (#3965) - #3969
Merged
Merged
Conversation
Adapt element conversion input and output nullability while preserving null guards. Backport the array and list regression tests; the inherited nullable-comparer query test is unavailable in EF8. Co-authored-by: Copilot App <[email protected]> Copilot-Session: cdf2d065-d9c8-4f52-85ea-379a40d76928
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.
Backports #3965 (d33cdd4) to
hotfix/8.0.12, related to #3919.Adapt the element conversion lambda's input and output to the collection element types while preserving existing null handling. Retain the array/list round-trip regression tests, using the release branch's existing initializer style. Omit the inherited nullable-comparer query test because it is unavailable in EF8.
Validation: both new regression tests reproduced the original expression-type exception before the fix; all six converter unit tests and 75 focused collection/converter functional tests pass afterward (.NET 8.0.425, PostgreSQL 18).
EF8 limitation: a standalone
ToQueryString()reproduction ofint[] numberswithnumbers.Contains(x.Num.Value)and aValueConverter<int?, string>now gets past the original converter expression exception, but still fails with a separateMissingMethodExceptionconstructingJsonCollectionReaderWriter<int[], int[], int>. This is the nullable JSON reader-writer mismatch reported in #3842 and addressed by #3843, whose JSON mapping fix is absent from EF8. This PR intentionally backports only #3965; it does not include that separate JSON mapping change.