title: Starting tasks in a for loop and then doing waitall on all of them
body: <p>I saw couple of posts on this... but most people are manually creating tasks rather than receiving it from an API.</p>
  
  <p>I have this code</p>
  
  <pre><code>        Task[] tasks = new Task[companyCount];
          // start all threads
          for(int i = 0; i &lt; companyCount; i++) {
              string input = GetNextCompanyRecord(i);
              string token = GetUserToken();
              HttpClient client = GetHttpClient();
              StringContent content = CreateStringContent(input);
              var x = client.PostAsync(companyUrlString, content).ConfigureAwait(continueOnCapturedContext: false);
              tasks[i] = x;
          }
          Task.WaitAll(tasks);
  </code></pre>
  
  <p>the objective is that I start the task for each record in a for loop and then when all tasks are started ... doing a single waitall.</p>
  
  <p>problem is that I cannot assign the x variable to the task array.</p>
  
  <p>The PostAsync method is not returning me the Task. instead it is returning ConfiguredTaskAwaitable. But my hope was that I will get Task and I will be able to add that to my array and then do a waitall.</p>