问题
I am using Dapper on ODBC provider, which as known does not support named parameters. For most of my queries I used pseudo named parameters: ?name?
. However, when I try to
string query = $"select * from \"{TableName}\" where ID in ?Ids?";
return connection.Query<CdfGroupByCdfUserRecord>(query, new {Ids = ids}).ToArray();
I see that Dapper generates query
select * from "MY_TABLE" where ID in (?Ids1,?Ids2,?Ids3,?Ids4,?Ids5)?
What should I do to get it work?
回答1:
This appears to be a bug in dapper. I'll try to fix it for 1.50.2. I've logged it (for tracking purposes) here
来源:https://stackoverflow.com/questions/38527197/dapper-where-in-statement-with-odbc