The awaitable and awaiter In C# 5.0 Asynchronous

后端 未结 3 1833
醉酒成梦
醉酒成梦 2021-02-07 18:48

Task or Task object is awaitable, so we can use await key on those whose return value is Task or Task. Task or Task are the most fr

3条回答
  •  无人及你
    2021-02-07 19:21

    I think the main reason is what you stated in point #1

    instance method or extension method

    Simply, because they want to enable the user to make an object Awaitable by defining an extension method for it, hence, you can make an object Awaitable even if you don't own it.

    Checkout this article

提交回复
热议问题