Answers for "dapper delete in list"

C#
1

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() } }
Posted by: Guest on November-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language