예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        public GatewayMiddleware(RequestDelegate next, GatewayOptions options)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options;
        }
예제 #4
0
        public GatewayMiddleware(RequestDelegate next, GatewayOptions options)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options;
        }
예제 #5
0
        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;
        }