📅  最后修改于: 2022-03-11 14:48:22.936000             🧑  作者: Mango
public async Task RunAsync()
{
var tasks = new List();
foreach (var x in new[] { 1, 2, 3 })
{
var task = DoSomethingAsync(x);
tasks.Add(task);
}
await Task.WhenAll();
}