call async method without await #2

后端 未结 3 719
花落未央
花落未央 2020-12-02 15:55

I have an async method:

public async Task ValidateRequestAsync(string userName, string password)
{
    using (HttpClient client = new HttpClient(         


        
3条回答
  •  囚心锁ツ
    2020-12-02 15:56

    you could use return ValidateRequestAsync(userName, password).GetAwaiter().GetResult();

提交回复
热议问题