Dapper中条件为In的写法

今天用Dapper更新是用到了IN写法,园子里找了篇文章这样写到

传统sql in (1,2,3) 用dapper就这样写

conn.Query<Users>("SELECT * FROM Users s WHERE s.id IN (@ids) ",new { ids = new int[]{1,2,3}}) conn.Query<Users>("SELECT * FROM Users s WHERE s.id IN (@ids) ",new { ids = IDs.ToArray()})

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpgzdg.html