Which method creates a task that completes when all of several tasks have completed?
Correct answer B. Task.WhenAll
Explanation
Task.WhenAll takes several tasks and returns one that completes when every one of them has finished, so await Task.WhenAll(t1, t2) runs work concurrently and waits for all. If tasks return values, it produces an array of results. Task.WhenAny completes when the first task finishes, Task.Delay waits for a time span and Task.Yield forces an asynchronous yield.
Answer checked How we write and check questions
Discussion