Skip to content

Instantly share code, notes, and snippets.

@ramons03
Created May 31, 2017 14:09
Show Gist options
  • Save ramons03/2ccfd0d5bd4dfbce44081835f4dcf386 to your computer and use it in GitHub Desktop.
Save ramons03/2ccfd0d5bd4dfbce44081835f4dcf386 to your computer and use it in GitHub Desktop.
LINQ async options with lambda using whenall
var tasks = foos.Select(DoSomethingAsync).ToList();
await Task.WhenAll(tasks);
var results = await Task.WhenAll(tasks);
return await Task.WhenAll(tasks);
var tasks = foos.Select(foo => DoSomethingAsync(foo)).ToList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment