Dapper 是否使用诸如 Massive(@0, @1, ...) 中的编号参数,而不是命名为 (@a, @b, ...)?
有必要创建一个查询
//select @0 as val union select @1 union select @2 union select @3 union select @4
//union select @5 union select @6 union select @7 union select @8 union select @9
var sb = new StringBuilder("select @0 as val");
for (int i = 1; i < 10; i++)
{
sb.AppendFormat(" union select @{0}", i);
}
var query = sb.ToString();
//---Dapper = fail
var db = Connection;
var list = db.Query(query, param: new object[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
//---Massive = ok
var db2 = new Massive.DynamicModel(coins);
var list2 = db2.Query(query, args: new object[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
Dapper 的问题有哪些解决方案?