Awaiting multiple Tasks with different results

后端 未结 10 1510
醉话见心
醉话见心 2020-11-22 12:59

I have 3 tasks:

private async Task FeedCat() {}
private async Task SellHouse() {}
private async Task BuyCar() {}
         


        
10条回答
  •  旧巷少年郎
    2020-11-22 13:41

    You can use Task.WhenAll as mentioned, or Task.WaitAll, depending on whether you want the thread to wait. Take a look at the link for an explanation of both.

    WaitAll vs WhenAll

提交回复
热议问题