Skip to content

fix: Regression - Broken mapping of numeric arrays in Postgres (#2231 & #2234) - #2239

Open
leandrommedeiros wants to merge 1 commit into
DapperLib:mainfrom
leandrommedeiros:bugfix/2231/regression-broken_mapping_of_numeric_arrays_in_postgres
Open

leandrommedeiros wants to merge 1 commit into
DapperLib:mainfrom
leandrommedeiros:bugfix/2231/regression-broken_mapping_of_numeric_arrays_in_postgres

Conversation

@leandrommedeiros

@leandrommedeiros leandrommedeiros commented Sep 25, 2026 •

Copy link
Copy Markdown

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 #2231 and #2234

…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

No deployments
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.

PostgreSQL SMALLINT[] mapping fails in Dapper 2.1.86 but works in 2.1.79

1 participant