Transform IEnumerable asynchronously by awaiting each task

What about this:

await Task.WhenAll(tasks1);
var gainStrings = tasks1.Select(t => t.Result).ToList();

Wait for all tasks to end and then extract results. This is ideal if you don’t care in which order they are finished.

EDIT2:
Even better way:

var gainStrings = await Task.WhenAll(tasks1);

Leave a Comment