In .NET 4, is there any functional equivalent to .NET 4.5\'s System.Threading.Tasks.Task.WhenAll()?
The goal is to wrap up multiple async tasks into a single one that is
Try waiting on Task.WaitAll() in another Task. Use the LINQ extension method ToArray to convert from IEnumerable to Task[].
Task.WaitAll()
ToArray
IEnumerable
Task[]
Task WhenAll(IEnumerable tasks) { return Task.Factory.StartNew(() => Task.WaitAll(tasks.ToArray())); }