调用ConfigreA的最佳实践-等待所有服务器端代码
ApiControllerTask<SomeObject>ConfigureAwait(false)?
ConfigureAwait(false)ApiController
public class CustomerController : ApiController{
public async Task<Customer> Get(int id)
{
// you are on a particular thread here
var customer = await SomeAsyncFunctionThatGetsCustomer(id).ConfigureAwait(false);
// now you are on a different thread! will that cause problems?
return customer;
}
白衣染霜花
白衣非少年
随时随地看视频慕课网APP