Skip to content

[8.0] Fix Contains on an object collection over a value-converted column (#3961) - #3972

Merged
roji merged 1 commit into
hotfix/8.0.12from
roji-object-contains-backport-8-0
Oct 16, 2026
Merged

roji merged 1 commit into
hotfix/8.0.12from
roji-object-contains-backport-8-0

Conversation

@roji

@roji roji commented Oct 16, 2026

Copy link
Copy Markdown
Member

Backports #3961 (4430302) to hotfix/8.0.12 for #3916. The nullable element-converter prerequisite #3965 is already included via #3969.

Supports object[] and List<object> parameters in Contains over value-converted columns, including null collection elements.

EF8 adaptations:

  • Keep EF8's existing ObjectListComparer, which already accepts the typed element comparer; no newer comparer APIs are needed.
  • Adapt object-element JSON handling using EF8's JsonCastValueReaderWriter<object>.
  • Reuse the existing converted-enum columns in ArrayArrayQueryTest for the compact array/list theory because EF8's primitive-collection fixture has no WrappedId/NullableWrappedId. Retain all upstream converter unit cases. No standalone context/fixture or dependency changes.

Validation with .NET SDK 8.0.425:

  • Debug solution build: succeeded with no warnings/errors.
  • Converter and type-mapping unit tests: 208 passed, 6 skipped.
  • PostgreSQL 18.4 focused functional tests: 38 passed, covering both new array/list cases, converted-column regressions, null collection elements, and nullable primitive-collection Contains.
dotnet build --configuration Debug --verbosity quiet
dotnet test test/EFCore.PG.Tests/EFCore.PG.Tests.csproj --no-build --configuration Debug --filter 'FullyQualifiedName~NpgsqlArrayValueConverterTest|FullyQualifiedName~NpgsqlTypeMappingTest|FullyQualifiedName~NpgsqlTypeMappingSourceTest' --verbosity quiet
dotnet test test/EFCore.PG.FunctionalTests/EFCore.PG.FunctionalTests.csproj --no-build --configuration Debug --filter 'FullyQualifiedName~Parameter_collection_of_objects_with_value_converter_Contains|FullyQualifiedName~Array_param_Contains_value_converted|FullyQualifiedName~Array_param_with_null_Contains|FullyQualifiedName~Parameter_collection_of_nullable_ints_Contains|FullyQualifiedName~Parameter_collection_of_nullable_strings_Contains' --verbosity quiet

…umn (#3961)

Backport the fix for #3916 to EF Core 8. Reuse the existing converted-enum array fixture and EF8 object comparer/JSON reader APIs.

(cherry picked from commit 4430302)

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: f702d425-9c3d-4084-8828-c40862e8c3d8
@roji
roji merged commit a603fed into hotfix/8.0.12 Oct 16, 2026
9 checks passed
@roji
roji deleted the roji-object-contains-backport-8-0 branch October 16, 2026 09:02
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.

object[]/List<object> Contains over a value-converted column throws in NpgsqlArrayConverter

2 participants