title: How to pass multiple records to update with one sql statement in Dapper
body: <p>I am attempting to use one single Update statement to update multiple records with different values (I'm not trying to update many rows to have the same values which is pretty straight forward).  Here's what I'm trying right now:</p>
  
  <pre><code>    using (var cn = GetOpenConnection()) {
  
          // get items where we need to set calculated fields that will now be persisted in the DB
          var items = cn.Query&lt;MaintenanceItem&gt;("select TOP 500 * from [Maintenance] where Tolerance IS NOT NULL");
  
          foreach (var mi in maintItems)
          {
              // Set calculated fields on multiple recrods
              logic.CalculateToleranceFields(mi, true);
          }
  
  
          var updateInput = items.Select(a =&gt; new {a.ToleranceMonths, a.ToleranceDays, a.ToleranceHours, a.ToleranceLandings, a.ToleranceCycles, a.ToleranceRIN }).ToList();
  
         // THIS DOESN'T WORK - attempting to update multiple rows with different values
         var numResults = cn.Execute(@"UPDATE rm 
                  SET rm.ToleranceMonths=ur.ToleranceMonths, 
                  rm.ToleranceDays=ur.ToleranceDays, 
                  rm.ToleranceHours=ur.ToleranceHours, 
                  rm.ToleranceLandings=ur.ToleranceLandings, 
                  rm.ToleranceCycles=ur.ToleranceCycles, 
                  rm.ToleranceRIN=ur.ToleranceRIN 
              from [RoutineItems] rm
              Inner Join @UpdatedRecords ur ON rm.AircraftId=ur.AircraftId AND rm.ItemNumber=ur.ItemNumber", updateInput);
  
          Assert.IsTrue(numResults == maintItems.Count());
  
      }
  </code></pre>
  
  <p>Is this sort of bulk update possible with Dapper?  I would rather do the update in bulk rather than using a for loop to push the data into the DB.  </p>