title: Dapper update query with multiple parameters of different type
body: <p>I have just started using Dapper and I have the following code that produces a query based on a combination of parameters (a list and a local variable)</p>
  
  <pre><code>var sqlQuery = $"UPDATE MyItem SET ItemOrder = @ItemOrder WHERE Id = @Id AND TenantId = @TenantId;";
  
  var parameters = new DynamicParameters();
  parameters.Add("@ItemOrder", myItems.Select(x=&gt; x.ItemOrder));
  parameters.Add("@Id", myItems.Select(x =&gt; x.Id));
  parameters.Add("@TenantId", SessionInfo.TenantId);
  
  await dbConnection.ExecuteAsync(sqlQuery, parameters, transaction: transaction);
  </code></pre>
  
  <p>and I can see in SQL Server Profiler the following query that is executed</p>
  
  <pre><code>exec sp_executesql N'UPDATE MyItem SET ItemOrder = (@ItemOrder1,@ItemOrder2,@ItemOrder3) WHERE Id = (@Id1,@Id2,@Id3) AND TenantId = @TenantId;',
  N'@ItemOrder1 int,@ItemOrder2 int,@ItemOrder3 int,@Id1 bigint,@Id2 bigint,@Id3 bigint,@TenantId bigint',
  @ItemOrder1=1,@ItemOrder2=2,@ItemOrder3=3,@Id1=1,@Id2=2,@Id3=5,@TenantId=1
  </code></pre>
  
  <p>which returns <code>Incorrect syntax near ','</code></p>
  
  <p>Why am I getting this error. What am I doing wrong?</p>