Converting a list of a type that needs a TypeHandler
Hi!
We are using dapper with F# and MSSQL and stumbled accross a problem that - I guess - I hunted down. Give a minute to explain:
Our database has several Ids, all Guids. To distinguish those Guids we encapsulate them in single case unions, let's call one of them CapGuid here. Of course dapper can't know there is a Guid underlying - so we we wrote a nice TypeHandler that pulls the Guid out of the capsule.
Unfortunately that doesn't work with lists of CapGuid. The problem seems to be that in
public static void PackListParameters(IDbCommand command, string namePrefix, object value)
the TypeHandlers are never called.
The TypeMappings are used (dbType = LookupDbType(item.GetType(), "", true, out ITypeHandler handler);) but the Handlers are not. So in lists our CapGuid is never converted back to Guid and the resulting commands don't work.
Best, Wolfram
Sounds like the same issue as #1649