public RoutingMiddleware(
     RequestDelegate next,
     IRouteRegistry <TRequest, TResponse> routeRegistry,
     MapContextToRequest <TRequest> mapContextToRequest,
     ApplyResponseToContext <TResponse> applyResponseToContext)
 {
     _routeRegistry          = routeRegistry;
     _mapContextToRequest    = mapContextToRequest;
     _applyResponseToContext = applyResponseToContext;
 }
Exemplo n.º 2
0
 public static IApplicationBuilder UseRouting <TRequest, TResponse>(
     this IApplicationBuilder applicationBuilder,
     IRouteRegistry <TRequest, TResponse> routeRegistry,
     MapContextToRequest <TRequest> mapContextToRequest,
     ApplyResponseToContext <TResponse> applyResponseToContext)
 {
     return(applicationBuilder.UseMiddleware <RoutingMiddleware <TRequest, TResponse> >(
                routeRegistry,
                mapContextToRequest,
                applyResponseToContext));
 }