title: Appropriate Structure for Task.Factory.ContinueWhenAll call
body: <p>I want to make sure that I am using ContinueWhenAll appropriately.  I have a number of calls which will run asynch and then I want to complete to a final task only after the other tasks have completed successfully and after I do some calcs on the results to see if I should instead stop processing and return a forbidden HTTP result.  What I am unsure about is whether the final line will actually wait for all the other tasks to complete, or whether I need to structure it differently.  If so, how should the last line be structured so that it is called ONLY if I get past the evaluation of if(getPlatformTask.Result...</p>
  
  <pre><code>// run some tasks and then gather them here
  Task.Factory.ContinueWhenAll(new Task[]{ getPlatformTask, getUserTask },
      (tasks) =&gt;
      {
          Task.WaitAll(tasks);
  
          if (getPlatformTask.Result == null || getUserTask.Result == null)
          {
             return Task&lt;HttpResponseMessage&gt;.Factory.StartNew(() =&gt;
             {
                return new HttpResponseMessage(HttpStatusCode.Forbidden);
             });
          }
      });
  
  // will this line below get called before the inner task above completes?   
  return base.SendAsync(request, cancellationToken);       
  </code></pre>