The return type of an async method must be void, Task or Task in C#

前端 未结 2 1598
逝去的感伤
逝去的感伤 2021-01-26 02:57

I have the following method and getting the following error. I wonder how could I able to overcome on this issue.

The return type of an async method must

2条回答
  •  有刺的猬
    2021-01-26 03:28

    You need to wrap your return type in a Task.

    private static async Task GoRequest(string url, Dictionary parameters, HttpMethod method, string body = "")
        where T : object
    

提交回复
热议问题