Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Dapper.Net 中有没有办法插入代码以进行类型之间的映射?我将 Dapper.Net 与 oracle 一起使用,而 Dapper.Net 不会将我的 int16(这就是我的布尔值在 oracle 中表示的方式)转换为布尔值。我查看了代码,我认为 Dapper.Net 期望从 DataReader 返回的类型与对象上的类型相匹配。我想我可以更新代码来做我想做的事,但是我必须从一个版本到另一个版本来维护它。
一种选择是在查询中进行强制转换,例如:
declare @val as int; set @val = 1; select CAST(@val as bit);
注意:上面的代码是针对 SQL Server 的,但你应该明白...