title: Stream is closing when using Async/Await
body: <p>I have a little service to upload blobs to Azure Storage. I am trying to use it from a WebApi async action, but my <code>AzureFileStorageService</code> says the stream is closed.</p>
  
  <p>I am new to async/await, are there any good resources to help me better understand it?</p>
  
  <p><strong>WebApi Controller</strong></p>
  
  <pre><code>public class ImageController : ApiController
  {
      private IFileStorageService fileStorageService;
  
      public ImageController(IFileStorageService fileStorageService)
      {
          this.fileStorageService = fileStorageService;
      }
  
      public async Task&lt;IHttpActionResult&gt; Post()
      {
          if (!Request.Content.IsMimeMultipartContent())
          {
              throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.UnsupportedMediaType));
          }
  
          await Request.Content.ReadAsMultipartAsync(new MultipartMemoryStreamProvider()).ContinueWith((task) =&gt;
          {
  
              foreach (var item in task.Result.Contents)
              {
                  using (var fileStream = item.ReadAsStreamAsync().Result)
                  {
                      fileStorageService.Save(@"large/Sam.jpg", fileStream);
                  }
  
                  item.Dispose();
              }
  
          });
  
          return Ok();
      }
  }
  </code></pre>
  
  <p><strong>AzureFileStorageService</strong></p>
  
  <pre><code>public class AzureFileStorageService : IFileStorageService
  {
      public async void Save(string path, Stream source)
      {
          await CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"])
              .CreateCloudBlobClient()
              .GetContainerReference("images")
              .GetBlockBlobReference(path)
              .UploadFromStreamAsync(source); // source throws a stream is disposed exception
      }
  }
  </code></pre>