public void Handle(IMiddlewareContext context) { if (_IsCompatible <TAction>(context.Action)) { _middleware.Handle(new MiddlewareContextAdapter <TAction>(context)); } else { context.Next(); } }
public MiddlewareStack <T, TReq, TRes> Use(IMiddleware <T, TReq, TRes> middleware) { return(Use(next => (user, request, response) => middleware.Handle(user, request, response, next))); }