这是可行的:
var list = conn.Query<int>(
"select Id from Person where Id in @ids",
new { ids = new int[] { 1, 2, 3 } }
);这将引发“不存在从对象类型System.Int32[]到已知的托管提供程序本机类型的映射。”:
DynamicParameters parameters = new DynamicParameters(
new { ids = new int[] { 1, 2, 3 } }
);
var list2 = conn.Query<int>(
"select Id from Person where Id in @ids",
parameters
);有什么想法吗?
发布于 2011-09-05 11:57:31
只是在最新的dapper (从hg抓取)中修复了这个问题,代码用于绕过DynamicParameters值提取。现在运行的代码是相同的。
https://stackoverflow.com/questions/6711012
复制相似问题