public static IApplicationBuilder RunGateway(this IApplicationBuilder app, GatewayOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return(app.UseMiddleware <GatewayMiddleware>(options)); }
public static IApplicationBuilder RunGateway(this IApplicationBuilder app, GatewayOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } return app.UseMiddleware<GatewayMiddleware>(options); }
public GatewayMiddleware(RequestDelegate next, GatewayOptions options) { if (next == null) { throw new ArgumentNullException(nameof(next)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _options = options; }
public GatewayMiddleware(RequestDelegate next, HttpRequestDispatcherProvider dispatcherProvider, IOptions <GatewayOptions> options) { if (dispatcherProvider == null) { throw new ArgumentNullException(nameof(dispatcherProvider)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _dispatcherProvider = dispatcherProvider; _options = options.Value; }