Remember that supplied tasks has to have the same result type.
We should be able to do a Task.WhenAll on tasks with different return types.
await Task.WhenAll(taskReturnsInt, taskReturnsString);
// next lines would execute only after Task.WhenAll completed// block and get resultvar intResult = taskReturnsInt.Result;
// or asynchronously get resultvar stringResult = await taskReturnsString;
kndb
Hey Kuba, nice article!
On
We should be able to do a Task.WhenAll on tasks with different return types.
await Task.WhenAll(taskReturnsInt, taskReturnsString); // next lines would execute only after Task.WhenAll completed // block and get result var intResult = taskReturnsInt.Result; // or asynchronously get result var stringResult = await taskReturnsString;