title: Convert existing C# synchronous method to asynchronous with async/await?
body: <p>Starting with a synchronous I/O bound method (below), how do I make it asynchronous using async/await?</p>
  
  <pre><code>public int Iobound(SqlConnection conn, SqlTransaction tran)
  {
      // this stored procedure takes a few seconds to complete
      SqlCommand cmd = new SqlCommand("MyIoboundStoredProc", conn, tran);
      cmd.CommandType = CommandType.StoredProcedure;
  
      SqlParameter returnValue = cmd.Parameters.Add("ReturnValue", SqlDbType.Int);
      returnValue.Direction = ParameterDirection.ReturnValue;
      cmd.ExecuteNonQuery();
  
      return (int)returnValue.Value;
  }
  </code></pre>
  
  <p>MSDN examples all presume the preexistence of an *Async method and offer no guidance for making one yourself for I/O-bound operations. </p>
  
  <p>I could use Task.Run() and execute Iobound() within that new Task, but new Task creation is discouraged since the operation is not CPU-bound.</p>
  
  <p>I'd like to use async/await but I'm stuck here on this fundamental problem of how to proceed with the conversion of this method.</p>