我有一个像这样的标准ASP.NET身份验证过滤器实现。
public async Task<HttpResponseMessage> ExecuteAuthorizationFilterAsync(HttpActionContext context, CancellationToken cancellationToken, Func<Task<HttpResponseMessage>> continuation)
{
await OnAuthorizeAsync(context);
return context.Response ?? await continuation();
}
continuation
是否可以在null
中成为IAuthorizationFilter.ExecuteAuthorizationFilterAsync(HttpActionContext actionContext, CancellationToken cancellationToken, Func<Task<HttpResponseMessage>> continuation)
,我应该添加空检查吗?