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