Async await how to use return values

后端 未结 4 2035
猫巷女王i
猫巷女王i 2021-02-04 00:41

I have a windows service that I have inherited from another developer, it runs very slow and has numerous slow call to the eBay API. I wish to speed it up without too much refac

4条回答
  •  猫巷女王i
    2021-02-04 00:50

    Use Result property on Task class:

    await Task.WhenAll(partNumberCollection, additionalProductDetials);
    
    var partNumberCollectionResult = partNumberCollection.Result;
    var additionalProductDetialsResult = additionalProductDetials.Result;
    

提交回复
热议问题