• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RequestDelegate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HttpServiceGatewayMiddleware

        public HttpServiceGatewayMiddleware(
            RequestDelegate next,
            ILoggerFactory loggerFactory,
            IHttpCommunicationClientFactory httpCommunicationClientFactory,
            IOptions<HttpServiceGatewayOptions> gatewayOptions)
        {
            if (next == null)
                throw new ArgumentNullException(nameof(next));

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

            if (httpCommunicationClientFactory == null)
                throw new ArgumentNullException(nameof(httpCommunicationClientFactory));

            if (gatewayOptions?.Value == null)
                throw new ArgumentNullException(nameof(gatewayOptions));

            if (gatewayOptions.Value.ServiceName == null)
                throw new ArgumentNullException($"{nameof(gatewayOptions)}.{nameof(gatewayOptions.Value.ServiceName)}");

            // "next" is not stored because this is a terminal middleware
            _logger = loggerFactory.CreateLogger(HttpServiceGatewayDefaults.LoggerName);
            _httpCommunicationClientFactory = httpCommunicationClientFactory;
            _gatewayOptions = gatewayOptions.Value;
        }
开发者ID:CESARDELATORRE,项目名称:ServiceFabric-Http,代码行数:26,代码来源:HttpServiceGatewayMiddleware.cs


示例17: StaticFileMiddleware

        /// <summary>
        /// Creates a new instance of the StaticFileMiddleware.
        /// </summary>
        /// <param name="next">The next middleware in the pipeline.</param>
        /// <param name="options">The configuration options.</param>
        /// <param name="loggerFactory">An <see cref="ILoggerFactory"/> instance used to create loggers.</param>
        public StaticFileMiddleware(RequestDelegate next, IHostingEnvironment hostingEnv, StaticFileOptions options, ILoggerFactory loggerFactory)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

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

            if (options.ContentTypeProvider == null)
            {
                throw new ArgumentException(Resources.Args_NoContentTypeProvider);
            }
            options.ResolveFileProvider(hostingEnv);

            _next = next;
            _options = options;
            _matchUrl = options.RequestPath;
            _logger = loggerFactory.CreateLogger<StaticFileMiddleware>();
        }
开发者ID:codehaks,项目名称:StaticFiles,代码行数:39,代码来源:StaticFileMiddleware.cs


示例18: RequestIdMiddleware

 public RequestIdMiddleware(RequestDelegate next, ILogger<RequestIdMiddleware> logger)
 {
     if (next == null) throw new ArgumentNullException(nameof(next));
     if (logger == null) throw new ArgumentNullException(nameof(logger));
     _next = next;
     _logger = logger;
 }
开发者ID:eaardal,项目名称:aspnet5-workshop,代码行数:7,代码来源:RequestIdMiddleware.cs


示例19: SessionMiddleware

        public SessionMiddleware(
            [NotNull] RequestDelegate next,
            [NotNull] ILoggerFactory loggerFactory,
            [NotNull] IEnumerable<ISessionStore> sessionStore,
            [NotNull] IOptions<SessionOptions> options,
            [NotNull] ConfigureOptions<SessionOptions> configureOptions)
        {
            _next = next;
            _logger = loggerFactory.Create<SessionMiddleware>();
            if (configureOptions != null)
            {
                _options = options.GetNamedOptions(configureOptions.Name);
                configureOptions.Configure(_options);
            }
            else
            {
                _options = options.Options;
            }

            if (_options.Store == null)
            {
                _options.Store = sessionStore.FirstOrDefault();
                if (_options.Store == null)
                {
                    throw new ArgumentException("ISessionStore must be specified.");
                }
            }

            _options.Store.Connect();
        }
开发者ID:vagelious,项目名称:ergotaxionion,代码行数:30,代码来源:SessionMiddleware.cs


示例20: RequestCultureMiddleware

 public RequestCultureMiddleware(RequestDelegate next, IOptions<RequestCultureOptions> options)
 {
     if (next == null) throw new ArgumentNullException(nameof(next));
     if (options == null) throw new ArgumentNullException(nameof(options));
     _next = next;
     _options = options.Value;
 }
开发者ID:eaardal,项目名称:aspnet5-workshop,代码行数:7,代码来源:RequestCultureMiddleware.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RequestFields类代码示例发布时间:2022-05-24
下一篇:
C# RequestData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap