当前位置: 首页>>代码示例>>C#>>正文


C# RequestDelegate类代码示例

本文整理汇总了C#中RequestDelegate的典型用法代码示例。如果您正苦于以下问题:C# RequestDelegate类的具体用法?C# RequestDelegate怎么用?C# RequestDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RequestDelegate类属于命名空间,在下文中一共展示了RequestDelegate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ErrorHandler

 public ErrorHandler(RequestDelegate next, int status, IErrorPage page, WebServiceType check)
 {
     _next = next;
     _page = page;
     _status = status;
     _check = check;
 }
开发者ID:inkysigma,项目名称:InkySigma,代码行数:7,代码来源:ErrorHandler.cs

示例2: THttpServerTransport

        public THttpServerTransport(ITAsyncProcessor processor, ITProtocolFactory inputProtocolFactory,
            ITProtocolFactory outputProtocolFactory, RequestDelegate next, ILoggerFactory loggerFactory)
        {
            if (processor == null)
            {
                throw new ArgumentNullException(nameof(processor));
            }

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

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

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

            Processor = processor;
            InputProtocolFactory = inputProtocolFactory;
            OutputProtocolFactory = outputProtocolFactory;

            _next = next;
            _logger = loggerFactory.CreateLogger<THttpServerTransport>();
        }
开发者ID:nsuke,项目名称:thrift,代码行数:30,代码来源:THttpServerTransport.cs

示例3: RaygunAspNetMiddleware

    public RaygunAspNetMiddleware(RequestDelegate next, IOptions<RaygunSettings> settings, RaygunMiddlewareSettings middlewareSettings)
    {
      _next = next;
      _middlewareSettings = middlewareSettings;

      _settings = _middlewareSettings.ClientProvider.GetRaygunSettings(settings.Value ?? new RaygunSettings());  
    }
开发者ID:MindscapeHQ,项目名称:raygun4net,代码行数:7,代码来源:RaygunAspNetMiddleware.cs

示例4: OrchardRouterMiddleware

 public OrchardRouterMiddleware(
     RequestDelegate next,
     ILogger<OrchardRouterMiddleware> logger)
 {
     _next = next;
     _logger = logger;
 }
开发者ID:vairam-svs,项目名称:Orchard2,代码行数:7,代码来源:OrchardRouterMiddleware.cs

示例5: CorsMiddleware

        /// <summary>
        /// Instantiates a new <see cref="CorsMiddleware"/>.
        /// </summary>
        /// <param name="next">The next middleware in the pipeline.</param>
        /// <param name="corsService">An instance of <see cref="ICorsService"/>.</param>
        /// <param name="policyProvider">A policy provider which can get an <see cref="CorsPolicy"/>.</param>
        /// <param name="policyName">An optional name of the policy to be fetched.</param>
        public CorsMiddleware(
            RequestDelegate next,
            ICorsService corsService,
            ICorsPolicyProvider policyProvider,
            string policyName)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

            _next = next;
            _corsService = corsService;
            _corsPolicyProvider = policyProvider;
            _corsPolicyName = policyName;
        }
开发者ID:HydAu,项目名称:AspNetCors,代码行数:33,代码来源:CorsMiddleware.cs

示例6: WebSocketMiddleware

        public WebSocketMiddleware(RequestDelegate next, WebSocketOptions options)
        {
            _next = next;
            _options = options;

            // TODO: validate options.
        }
开发者ID:hitesh97,项目名称:WebSockets,代码行数:7,代码来源:WebSocketMiddleware.cs

示例7: IdentityServerAuthenticationMiddleware

        public IdentityServerAuthenticationMiddleware(RequestDelegate next, IApplicationBuilder app, CombinedAuthenticationOptions options, ILogger<IdentityServerAuthenticationMiddleware> logger)
        {
            _next = next;
            _options = options;
            _logger = logger;

            // building pipeline for introspection middleware
            if (options.IntrospectionOptions != null)
            {
                var introspectionBuilder = app.New();
                introspectionBuilder.UseOAuth2IntrospectionAuthentication(options.IntrospectionOptions);
                introspectionBuilder.Run(ctx => next(ctx));
                _introspectionNext = introspectionBuilder.Build();
            }

            // building pipeline for JWT bearer middleware
            if (options.JwtBearerOptions != null)
            {
                var jwtBuilder = app.New();
                jwtBuilder.UseJwtBearerAuthentication(options.JwtBearerOptions);
                jwtBuilder.Run(ctx => next(ctx));
                _jwtNext = jwtBuilder.Build();
            }

            // building pipeline for no token
            var nopBuilder = app.New();
            var nopOptions = new NopAuthenticationOptions
            {
                AuthenticationScheme = options.AuthenticationScheme
            };

            nopBuilder.UseMiddleware<NopAuthenticationMiddleware>(nopOptions);
            nopBuilder.Run(ctx => next(ctx));
            _nopNext = nopBuilder.Build();
        }
开发者ID:NetChris,项目名称:IdentityServer4.AccessTokenValidation,代码行数:35,代码来源:IdentityServerAuthenticationMiddleware.cs

示例8: DebugInfoPageMiddleware

 public DebugInfoPageMiddleware(RequestDelegate next, IServerAddressesFeature serverAddresses, IHostingEnvironment hostingEnv, Scenarios scenarios)
 {
     _next = next;
     _hostingEnv = hostingEnv;
     _scenarios = scenarios;
     _serverAddresses = serverAddresses;
 }
开发者ID:nathana1,项目名称:FrameworkBenchmarks,代码行数:7,代码来源:DebugInfoPageMiddleware.cs

示例9: PrerenderMiddleware

		public PrerenderMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IOptions<PrerenderConfiguration> configuration)
		{
			_next = next;
			this.configuration = configuration;
			logger = loggerFactory.CreateLogger<RequestLoggerMiddleware>();
			helper = new WebRequestHelper(logger, configuration.Options);
    }
开发者ID:OndrejValenta,项目名称:prerender.io.mvc6,代码行数:7,代码来源:PrerenderMiddleware.cs

示例10: ConditionalProxyMiddleware

 public ConditionalProxyMiddleware(RequestDelegate next, string pathPrefix, ConditionalProxyMiddlewareOptions options)
 {
     this.next = next;
     this.pathPrefix = pathPrefix;
     this.options = options;
     this.httpClient = new HttpClient(new HttpClientHandler());
 }
开发者ID:jimitndiaye,项目名称:NodeServices,代码行数:7,代码来源:ConditionalProxyMiddleware.cs

示例11: ApiErrorHandlerMiddleware

		public ApiErrorHandlerMiddleware(RequestDelegate next, ILogger<ApiErrorHandlerMiddleware> logger, IContextProblemDetectionHandler contextProblemDetectionHandler, IExceptionProblemDetectionHandler exceptionProblemDetectionHandler)
		{
			_next = next;
			_logger = logger;
			_contextProblemDetectionHandler = contextProblemDetectionHandler;
			_exceptionProblemDetectionHandler = exceptionProblemDetectionHandler;
		}
开发者ID:jwaimann,项目名称:aspnet-hypermedia-api,代码行数:7,代码来源:ApiErrorHandlerMiddleware.cs

示例12: Publish

        public void Publish(IEnumerable<RouteDescriptor> routes, RequestDelegate pipeline)
        {
            var orderedRoutes = routes
                .OrderByDescending(r => r.Priority)
                .ToList();

            string routePrefix = "";
            if (!String.IsNullOrWhiteSpace(_shellSettings.RequestUrlPrefix))
            {
                routePrefix = _shellSettings.RequestUrlPrefix + "/";
            }

            orderedRoutes.Insert(0, new RouteDescriptor
            {
                Route = new Route("Default", "{area}/{controller}/{action}/{id?}")
            });


            var inlineConstraint = _routeBuilder.ServiceProvider.GetService<IInlineConstraintResolver>();

            foreach (var route in orderedRoutes)
            {
                IRouter router = new TemplateRoute(
                    _routeBuilder.DefaultHandler,
                    route.Route.RouteName,
                    routePrefix + route.Route.RouteTemplate,
                    route.Route.Defaults,
                    route.Route.Constraints,
                    route.Route.DataTokens,
                    inlineConstraint);

                _routeBuilder.Routes.Add(new TenantRoute(_shellSettings, router, pipeline));
            }
        }
开发者ID:adwardliu,项目名称:Orchard2,代码行数:34,代码来源:RoutePublisher.cs

示例13: TenantRoute

 public TenantRoute(IRouter target, 
     string urlHost, 
     RequestDelegate pipeline) {
     _target = target;
     _urlHost = urlHost;
     _pipeline = pipeline;
 }
开发者ID:Giahim,项目名称:Brochard,代码行数:7,代码来源:TenantRoute.cs

示例14: OrchardShellHostMiddleware

        public OrchardShellHostMiddleware(
            RequestDelegate next,
            IShellHost shellHost) {

            _next = next;
            _shellHost = shellHost;
        }
开发者ID:josuecorrea,项目名称:Brochard,代码行数:7,代码来源:OrchardShellHostMiddleware.cs

示例15: RuntimeInfoMiddleware

        /// <summary>
        /// Initializes a new instance of the <see cref="RuntimeInfoMiddleware"/> class
        /// </summary>
        /// <param name="next"></param>
        /// <param name="options"></param>
        public RuntimeInfoMiddleware(
            RequestDelegate next,
            RuntimeInfoPageOptions options,
            ILibraryManager libraryManager,
            IRuntimeEnvironment runtimeEnvironment)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

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

            _next = next;
            _options = options;
            _libraryManager = libraryManager;
            _runtimeEnvironment = runtimeEnvironment;
        }
开发者ID:leloulight,项目名称:Diagnostics,代码行数:36,代码来源:RuntimeInfoMiddleware.cs


注:本文中的RequestDelegate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。