title: How to correctly await a task within a task?
body: <p>I'm using <a href="https://flurl.io/" rel="nofollow noreferrer">Flurl</a> to make requests. Currently I have the following code and everything works fine:</p>
  
  <pre><code>public class Request()
  {
      public async Task&lt;Bitmap&gt; GetImage(string url)
      {
          using (var client = new Url(url)
          {
              var content = await client.GetStringAsync();
              //return as image
          }
      }
  }
  </code></pre>
  
  <p>And on the main UI thread I do:</p>
  
  <pre><code>public async void GetImages()
  {
      for (int i = 0; i &lt; someCounter; i++)
      {
          var img = await myRequest.GetImage(url);
          Thread.Sleep(100);
      }
  }
  </code></pre>
  
  <p>The above works but the UI thread sleeps for a while and I wanted to do the above within a task. So I did:</p>
  
  <pre><code>public async void GetImages()
  {
      await Task.Run(async () =&gt; 
      {
          for (int i = 0; i &lt; someCounter; i++)
          {
              var img = await myRequest.GetImage(url);
              Thread.Sleep(100);
          }
      });
  }
  </code></pre>
  
  <p>However, with the above, the code stops at <code>await client.GetStringAsync();</code>. There's no exception, the code either stop execution there or waits for something.</p>
  
  <p>Is what I'm trying to do correct or is there a better way. If it's correct, why does the inner await never completes?</p>