Dapper 读取非默认类型

Dapper read non default types

Dapper 是否可以读取由 NpgsqlDataReader 实现的非默认类型?

Npgsql 为某些 postgresql 类型实现了多种类型:https://www.npgsql.org/doc/types/basic.html

The default type is returned when using NpgsqlCommand.ExecuteScalar(), NpgsqlDataReader.GetValue() and similar methods.

You can read as other types by calling NpgsqlDataReader.GetFieldValue<T>().

有没有办法强制Dapper在内部调用GetFieldValue<T>

我尝试注册一个 SqlMapper,但是当我为非默认类型注册它时,默认类型仍然传递给 Parse(object) 方法

暂时无法:https://github.com/StackExchange/Dapper/issues/1644