Dapper.FSharp
Dapper.FSharp copied to clipboard
Arrays are not covered in the OptionType-registration
Hi!
We are evaluating Dapper.FSharp. First thing we tried is to replace our registration-bag for OptionsTypes. You may have seen something like this before :-)
let register() =
SqlMapper.AddTypeHandler (OptionHandler<Guid>())
SqlMapper.AddTypeHandler (OptionHandler<byte>())
SqlMapper.AddTypeHandler (OptionHandler<byte[]>())
SqlMapper.AddTypeHandler (OptionHandler<int16>())
SqlMapper.AddTypeHandler (OptionHandler<int>())
SqlMapper.AddTypeHandler (OptionHandler<int64>())
SqlMapper.AddTypeHandler (OptionHandler<float>())
SqlMapper.AddTypeHandler (OptionHandler<decimal>())
SqlMapper.AddTypeHandler (OptionHandler<float32>())
SqlMapper.AddTypeHandler (OptionHandler<string>())
SqlMapper.AddTypeHandler (OptionHandler<char>())
SqlMapper.AddTypeHandler (OptionHandler<DateTime>())
SqlMapper.AddTypeHandler (OptionHandler<DateTimeOffset>())
SqlMapper.AddTypeHandler (OptionHandler<bool>())
SqlMapper.AddTypeHandler (OptionHandler<TimeSpan>())
We found that it works for most type, but not for the byte[] array type. So we cut it down to
let register() =
Dapper.FSharp.OptionTypes.register()
SqlMapper.AddTypeHandler (OptionHandler<byte[]>())
Do you think, Dapper.FSharp could cover those as well?
Best regards, Wolfram
Hi @tih2010,
sure, just send a PR and I'll deploy a new version. ;)