title: Task.Factory.StartNew with async lambda and Task.WaitAll
body: <p>I'm trying to use <code>Task.WaitAll</code> on a list of tasks.  The thing is the tasks are an async lambda which breaks <code>Tasks.WaitAll</code> as it never waits.</p>
  
  <p>Here is an example code block:</p>
  
  <pre><code>List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  tasks.Add(Task.Factory.StartNew(async () =&gt;
  {
      using (dbContext = new DatabaseContext())
      {
          var records = await dbContext.Where(r =&gt; r.Id = 100).ToListAsync();
          //do long cpu process here...
      }
  }
  Task.WaitAll(tasks);
  //do more stuff here  
  </code></pre>
  
  <p>This doesn't wait because of the async lambda.  So how am I supposed to await I/O operations in my lambda?</p>