call async method without await #2

后端 未结 3 716
花落未央
花落未央 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 16:11

    For me it worked using .ConfigureAwait(false) setting in the async call. I have something like

    return await Entities.SingleOrDefaultAsync(.....).ConfigureAwait(false);
    

提交回复
热议问题