I need to run multiple async tasks in a console application, and wait for them all to complete before further processing.
There\'s many articles out there, but I see
This is how I do it with an array Func<>:
var tasks = new Func[] { () => myAsyncWork1(), () => myAsyncWork2(), () => myAsyncWork3() }; await Task.WhenAll(tasks.Select(task => task()).ToArray()); //Async Task.WaitAll(tasks.Select(task => task()).ToArray()); //Or use WaitAll for Sync