Dapper icon indicating copy to clipboard operation
Dapper copied to clipboard

Delegate from one custom type handler to another.

Open abnercpp opened this issue 2 years ago • 0 comments

Let's say I have a value object (to avoid primitive obsession) and I want to create a custom type handler that internally just delegates to the appropriate type handler for the type backing my value object (e.g., treat record Username(string Value) as string, and make its type handler simply take Value and handle that instead using whichever type handler exists for a string type).

I considered the possibility of using SqlMapper.LookupDbType, but that's deprecated, and documentation says it's for internal use only. Are there any safe workarounds for this?

abnercpp avatar Jun 21 '23 02:06 abnercpp