title: Returning multiple values asynchronously
body: <p>I have the requirement of computing these two independent tasks.Earlier I was doing it serially like:</p>
  
  <pre><code>string firstHash = CalculateMD5Hash("MyName");
  string secondHash = CalculateMD5Hash("NoName");
  </code></pre>
  
  <p>And the method <code>calculateMD5Hash</code> looks like.It is used to calculate MD5 hash values for files as big as 16GB:</p>
  
  <pre><code>private string CalculateMD5(string filename)
  {
      using (var md5 = MD5.Create())
      {
          using (var stream = File.OpenRead(filename))
          {
              var hash = md5.ComputeHash(stream);
              return BitConverter.ToString(hash).Replace("-", string.Empty).ToLowerInvariant();
          }
      }
  }
  </code></pre>
  
  <p>But since these 2 <code>CalculateMD5Hash</code> methods can run in parallel, I was trying this:</p>
  
  <pre><code>Task&lt;string&gt; sequenceFileMd5Task = CalculateMD5("MyName");
  Task&lt;string&gt; targetFileMD5task = CalculateMD5("NoName");
  string firstHash = await sequenceFileMd5Task;
  string secondHash = await targetFileMD5task;
  </code></pre>
  
  <p>And my <code>CalculateMD5</code> method looks like:</p>
  
  <pre><code>private async Task&lt;string&gt; CalculateMD5(string filename)
  {
      using (var md5 = MD5.Create())
      {
          using (var stream = File.OpenRead(filename))
          {
              var hash = md5.ComputeHash(stream);
              return BitConverter.ToString(hash).Replace("-", string.Empty).ToLowerInvariant();
          }
      }
  }
  </code></pre>
  
  <p>I hoped for the code to work asynchronously, but it works synchronously.</p>