title: .Net parallel WaitAll()
body: <p>I have a situation in my code where i'm starting unknown number of tasks and would like to use <code>Task.WaitAll()</code>.</p>
  
  <p>something like this:</p>
  
  <pre><code>if (condition) 
  { 
      var task1 = Task.Factory.StartNew (call the web service1...);
  } 
  
  if (condition) 
  { 
      var task2 = Task.Factory.StartNew (call the web service2...);
  }
  
  if (condition) 
  { 
      var task3 = Task.Factory.StartNew (call the web service3...); 
  }
  
  Task.WaitAll(task1, task2, task3);
  </code></pre>
  
  <p>The problem is that i can't say </p>
  
  <pre><code>Task.WaitAll(task1, task2 , task3)
  </code></pre>
  
  <p>because i don't know which one of them will actually start.
  Any idea for a solution?</p>