📅  最后修改于: 2022-03-11 14:48:20.736000             🧑  作者: 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();
}