Ton*_*ony 1 asp.net-web-api cancellation-token
典型的Web API DelegatingHandler实现看起来像这样......
protected async override Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request, CancellationToken cancellationToken)
{
// TODO: Do work before inner handler here
// Call the inner handler.
var response = await base.SendAsync(request, cancellationToken);
// TODO: Do work _after_ inner handler here
return response;
}
Run Code Online (Sandbox Code Playgroud)
处理CancellationToken.IsCancellationRequested == true的首选方法是什么?
我是不是该:
归档时间: |
|
查看次数: |
1739 次 |
最近记录: |