本文整理汇总了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;
}
示例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>();
}
示例3: RaygunAspNetMiddleware
public RaygunAspNetMiddleware(RequestDelegate next, IOptions<RaygunSettings> settings, RaygunMiddlewareSettings middlewareSettings)
{
_next = next;
_middlewareSettings = middlewareSettings;
_settings = _middlewareSettings.ClientProvider.GetRaygunSettings(settings.Value ?? new RaygunSettings());
}
示例4: OrchardRouterMiddleware
public OrchardRouterMiddleware(
RequestDelegate next,
ILogger<OrchardRouterMiddleware> logger)
{
_next = next;
_logger = logger;
}
示例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;
}
示例6: WebSocketMiddleware
public WebSocketMiddleware(RequestDelegate next, WebSocketOptions options)
{
_next = next;
_options = options;
// TODO: validate options.
}
示例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;
}
示例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);
}
示例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());
}
示例11: ApiErrorHandlerMiddleware
public ApiErrorHandlerMiddleware(RequestDelegate next, ILogger<ApiErrorHandlerMiddleware> logger, IContextProblemDetectionHandler contextProblemDetectionHandler, IExceptionProblemDetectionHandler exceptionProblemDetectionHandler)
{
_next = next;
_logger = logger;
_contextProblemDetectionHandler = contextProblemDetectionHandler;
_exceptionProblemDetectionHandler = exceptionProblemDetectionHandler;
}
示例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));
}
}
示例13: TenantRoute
public TenantRoute(IRouter target,
string urlHost,
RequestDelegate pipeline) {
_target = target;
_urlHost = urlHost;
_pipeline = pipeline;
}
示例14: OrchardShellHostMiddleware
public OrchardShellHostMiddleware(
RequestDelegate next,
IShellHost shellHost) {
_next = next;
_shellHost = shellHost;
}
示例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;
}