📜  dapper delete where in list - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:44.179000             🧑  作者: Mango

代码示例1
The syntax for List<> support in dapper is slightly different than in an actual T-SQL query. See: https://github.com/StackExchange/Dapper

DELETE FROM [Employee] 
WHERE EmployeeId in @empIds
It does not require braces around the IN clause's parameter. And you can just pass an IEnumerable<>. Like this

new { empIds = new[] { Guid.NewGuid(), Guid.NewGuid() } }