public async Task HandleAsync(AuthorizationContext context) { foreach (var handler in context.Requirements.OfType<IAuthorizationHandler>()) { await handler.HandleAsync(context); } }
public void Handle(AuthorizationContext context) { foreach (var handler in context.Requirements.OfType<IAuthorizationHandler>()) { handler.Handle(context); } }
// REVIEW: do we need an async hook too? public abstract void Handle(AuthorizationContext context, TRequirement requirement);
public virtual Task HandleAsync(AuthorizationContext context) { Handle(context); return(Task.FromResult(0)); }