fix: Regression - Broken mapping of numeric arrays in Postgres (#2231 & #2234) - #2239
Open
leandrommedeiros wants to merge 1 commit into
Conversation
…rLib#2231 & DapperLib#2234) The DateOnly/TimeOnly conversion changes introduced in `6d48ef6` excluded `TypeCode.Object` from Dapper’s direct conversion path. As a result, provider-returned PostgreSQL arrays, such as `long[]`, could fall through to `Convert.ChangeType`, breaking mappings to compatible collection types such as `IReadOnlyCollection<long>`. This change preserves the new DateOnly/TimeOnly conversion behavior while restoring direct assignment when the provider value is assignable to the target type. A PostgreSQL regression test has also been added covering `bigint|int|smallint[]` to `IReadOnlyCollection<long|int|short>` mapping. Fixes DapperLib#2231 and DapperLib#2234
This branch has not been deployed
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.
The DateOnly/TimeOnly conversion changes introduced in 6d48ef6 excluded
TypeCode.Objectfrom Dapper’s direct conversion path. As a result, provider-returned PostgreSQL arrays, such aslong[], could fall through toConvert.ChangeType, breaking mappings to compatible collection types such asIReadOnlyCollection<long>.This change preserves the new DateOnly/TimeOnly conversion behavior while restoring direct assignment when the provider value is assignable to the target type.
A PostgreSQL regression test has also been added covering
bigint|int|smallint[]toIReadOnlyCollection<long|int|short>mapping.Fixes #2231 and #2234