Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

dapper delete where in list

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() } }
 
PREVIOUS NEXT
Tagged: #dapper #delete #list
ADD COMMENT
Topic
Name
8+9 =