title: Do using statements and await keywords play nicely in c#
body: <p>I have a situation where I am making an <code>async</code> call to a method that returns and <code>IDisposable</code> instance. For example:</p>
  
  <pre><code>HttpResponseMessage response = await httpClient.GetAsync(new Uri("http://www.google.com"));
  </code></pre>
  
  <p>Now before <code>async</code> was on the scene, when working with an <code>IDisposable</code> instance, this call and code that used the "response" variable would be wrapped in a using statement. </p>
  
  <p>My question is whether that is still the correct approach when the <code>async</code> keyword is thrown in the mix? Even though the code compiles, will the using statement still work as expected in both the examples below?</p>
  
  <p>Example 1</p>
  
  <pre><code>using(HttpResponseMessage response = await httpClient.GetAsync(new Uri("http://www.google.com")))
  {
      // Do something with the response
  
      return true;
  }
  </code></pre>
  
  <p>Example 2</p>
  
  <pre><code>using(HttpResponseMessage response = await httpClient.GetAsync(new Uri("http://www.google.com")))
  {
      await this.responseLogger.LogResponseAsync(response);
  
      return true;
  }
  </code></pre>