我正在尋找使用async
await
關鍵字在調用服務,但想知道是否需要await
關鍵字?使用異步呼叫服務等待
修改示例如果找到;我想這樣做的是建立一個async
調用到與任務都會獲得一個服務,但不需要等待迴應:
async Task CallService(InformationForService informationForService)
{
var service = SetupService();
// Does this need the await keyword?
service.Doof(informationForService);
}
什麼返回任務''? –
2013-03-08 10:18:52
您的代碼如何編譯? – 2013-03-08 10:22:25
對不起,從一個例子複製,我忘了我離開那個回報。 – 2013-03-08 10:27:50