Skip to content

Honor custom type handlers for built-in types - #2269

Open
celluj34 wants to merge 2 commits into
DapperLib:mainfrom
celluj34:fix/2266-type-handler-precedence
Open

celluj34 wants to merge 2 commits into
DapperLib:mainfrom
celluj34:fix/2266-type-handler-precedence

Conversation

@celluj34

Copy link
Copy Markdown

Summary

Ensure registered type handlers take precedence over Dapper's built-in mappings for non-enum types, so handlers control both parameter values and materialized reads. The optimized GetFieldValue<T>() path now defers to registered handlers as well, while preserving the existing opt-in behavior for enum handlers.

Adds a SQLite regression test covering DateOnly and nullable DateOnly parameter and read handling.

Fixes #2266.

Validation

  • dotnet test tests\Dapper.Tests\Dapper.Tests.csproj --no-restore --filter FullyQualifiedName~Issue2266 --verbosity minimal (net8.0 and net10.0)
  • dotnet test tests\Dapper.Tests\Dapper.Tests.csproj --no-restore --framework net8.0 --filter FullyQualifiedName~SqliteTypeHandlerTests --verbosity minimal

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

TypeHandler is not fully used for known types

1 participant