Is there any danger in using ConfigureAwait(false) in WebApi or MVC controllers?

前端 未结 4 1911
逝去的感伤
逝去的感伤 2021-01-31 07:43

Say I have two scenarios:

1) WebApi Controller

    [System.Web.Http.HttpPost]
    [System.Web.Http.AllowAnonymous]
    [Route(\"api/regi         


        
4条回答
  •  别那么骄傲
    2021-01-31 08:28

    Using ConfigureAwait(false) in controllers does not sound good to me as it will make main thread wait until the operation is finished. The best I figured out is to use it in your Service/Business layer and Persistance layer.

提交回复
热议问题