I have multiple tasks returning the same object type that I want to call using Task.WhenAll(new[]{t1,t2,t3});
and read the results.
When I try using <
Looks like you are using the overload of WaitAll()
that doesn't return a value. If you make the following changes, it should work.
List<string>[] all = await Task.WhenAll(new Task<List<string>>[] { t, t2 })
.ConfigureAwait(false);
The return type of WhenAll is a task whose result type is an array of the individual tasks' result type, in your case Task<List<string>[]>
When used in an await expression, the task will be "unwrapped" into its result type, meaning that the type of your "all" variable should be List<string>[]