What's the method signature for passing an async delegate?

后端 未结 3 1562
一整个雨季
一整个雨季 2020-12-08 13:11

I\'ve recently moved back to C# from being in Objective-C land, and the async/await keywords in C# 5 look cool. But I\'m still trying to get a handle on the proper syntax.

3条回答
  •  眼角桃花
    2020-12-08 13:22

    The return type of the method signatue is Task if there is no return type, or Task if there is a return type.

    Tho, I'm not 100% certain if you can have async lambdas like that.

    In the method that is consuming the task, you would either 'await' the task or use the properties and methods on Task to get the result.

提交回复
热议问题