title: Can anybody help to do bulk update using Dapper ORM?
body: <p>I have a table <code>employee</code>, and I have to update their location to new location, so I need a bulk update. Please help me to do so using Dapper O.R.M.</p>
  
  <p>My primary key is <code>Employee-id</code>.</p>
  
  <p>Below you can see the sample code which updates in single record at a time.</p>
  
  <pre><code>// Employees is list of class class Employee
  SqlConnection connection = new SqlConnection(connectionstring);
  connection.open();
  
  foreach (Employee employee in Employees)
  {
      string query = @"UPDATE [dbo].[Employee]    
                       SET Name = @Name, Age = @Age, Sex = @Sex, 
                           Location = @Location  
                       WHERE Id = @Id";
  
      connection.QueryAsync&lt;bool&gt;(query, new { @Id = employee.Id, @Name = employee.Name, 
                                               @Sex = employee.sex, @Age = employee.age, 
                                               @Location = employee.location})).SingleOrDefault();
  }   
  </code></pre>