title: Why await an async function directly not work without assigning it to a Task variable
body: <p>Typically, I do the following</p>
  
  <pre><code>public static async Task dosth()
  {
      List&lt;Task&gt; job = new List&lt;Task&gt;();
      for (int i = 0; i &lt; 3; i++)
      {
          job.Add(sleep());
      }
      Task.WhenAll(job.ToArray());
  }
  
  static async Task sleep()
  {
      await Task.Delay(1000);
      Console.WriteLine("Finish new");
  }
  </code></pre>
  
  <p>It works smoothly, no problem. But when I do a review on my own code (trying using other syntax to do the same job), I suddenly figure out the following two are different.</p>
  
  <pre><code>public static async Task dosthA()
  {
      //This will be working synchronously, take 3 seconds.
      await sleep();
      await sleep();
      await sleep();
  
      //This will be working asynchronously, take 1 second only.
      Task A = sleep();
      Task B = sleep();
      Task C = sleep();
      await A;
      await B;
      await C;
  }
  </code></pre>
  
  <p>Why assigning the async function to a new variable make difference? I originally think they are the same.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Why it is confusing me is, actually in <a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/index" rel="nofollow noreferrer">Microsoft doc on Async-await</a>,
  They stated the following in their code.</p>
  
  <pre><code>// Calls to TaskOfTResult_MethodAsync  
  Task&lt;int&gt; returnedTaskTResult = TaskOfTResult_MethodAsync();  
  int intResult = await returnedTaskTResult;  
  // or, in a single statement  
  int intResult = await TaskOfTResult_MethodAsync();  
  </code></pre>
  
  <p>They are actually different, why they use <code>//or , in a single statement</code>, just because it makes no different in their own example?</p>