DapperLib / DapperLib/Dapper

Dapper using type handler in useless case

Open
#1,840 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

image

Type handler are very utile when used to cast column. But when used to cast entire entity, is useless:
image

I'm use the same type as a json column in another table and it works ok. The problem is that it conflicts because the type handler is also called if I use .Query<ProfessionalRepassCriteria>()

It makes no sense for the typehandler to be used to cast the entire entity, because an int (or any primitive type) cannot return an entire entity.

image

The typehandler's interface doesn't allow returning the int type in this case, so it's useless to call this typehandler for each column within the type.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the type-handler interface and the Query() reproduction first. No file or test is named, so trace where the handler is invoked for entity mapping and compare it with the JSON-column case. Done means entity queries no longer invoke an unusable handler while column conversions continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.