735 references to RequestDelegate
BasicLinkedApp (1)
Startup.cs (1)
21public HelloWorldMiddleware(RequestDelegate next)
BasicWebSite (2)
RequestIdMiddleware.cs (2)
9private readonly RequestDelegate _next; 11public RequestIdMiddleware(RequestDelegate next)
CorsMiddlewareWebSite (1)
EchoMiddleware.cs (1)
14public EchoMiddleware(RequestDelegate next)
CustomAuthorizationFailureResponse (1)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
26RequestDelegate requestDelegate,
Diagnostics.EFCore.FunctionalTests (11)
DatabaseErrorPageMiddlewareTest.cs (10)
50public SuccessMiddleware(RequestDelegate next) 87public ExceptionMiddleware(RequestDelegate next) 114public DatabaseErrorButNoMigrationsMiddleware(RequestDelegate next) 152public NoMigrationsMiddleware(RequestDelegate next) 217public PendingMigrationsMiddleware(RequestDelegate next) 255public PendingModelChangesMiddleware(RequestDelegate next) 313public ApplyMigrationsMiddleware(RequestDelegate next) 414public ContextNotRegisteredInServicesMiddleware(RequestDelegate next) 463public ExceptionInLogicMiddleware(RequestDelegate next) 497public WrappedExceptionMiddleware(RequestDelegate next)
MigrationsEndPointMiddlewareTest.cs (1)
48public SuccessMiddleware(RequestDelegate next)
Http2SampleApp (2)
TimingMiddleware.cs (2)
14private readonly RequestDelegate _next; 16public TimingMiddleware(RequestDelegate next)
IIS.Microbenchmarks (2)
PlaintextBenchmark.cs (2)
47private readonly RequestDelegate _next; 49public PlaintextMiddleware(RequestDelegate next)
IIS.Tests (3)
Utilities\TestServer.cs (3)
81public static Task<TestServer> Create(RequestDelegate app, ILoggerFactory loggerFactory) 86public static Task<TestServer> Create(RequestDelegate app, ILoggerFactory loggerFactory, IISServerOptions options) 91public static Task<TestServer> CreateHttps(RequestDelegate app, ILoggerFactory loggerFactory)
InMemory.FunctionalTests (50)
ConnectionLimitTests.cs (2)
210private TestServer CreateServerWithMaxConnections(RequestDelegate app, long max, IMeterFactory meterFactory = null) 217private TestServer CreateServerWithMaxConnections(RequestDelegate app, ResourceCounter concurrentConnectionCounter, IMeterFactory meterFactory = null)
ConnectionMiddlewareTests.cs (9)
24public static TheoryData<RequestDelegate> EchoAppRequestDelegates => 25new TheoryData<RequestDelegate> 33public async Task CanReadAndWriteWithRewritingConnectionAdapter(RequestDelegate requestDelegate) 68public async Task CanReadAndWriteWithAsyncConnectionMiddleware(RequestDelegate requestDelegate) 98public async Task CanReadWriteThroughAsyncConnectionMiddleware(RequestDelegate requestDelegate) 131public async Task ImmediateFinAfterOnConnectionAsyncClosesGracefully(RequestDelegate requestDelegate) 151public async Task ImmediateFinAfterThrowingClosesGracefully(RequestDelegate requestDelegate) 172public async Task ImmediateShutdownAfterOnConnectionAsyncDoesNotCrash(RequestDelegate requestDelegate) 230public async Task ThrowingSynchronousConnectionMiddlewareDoesNotCrashServer(RequestDelegate requestDelegate)
Http2\Http2TestBase.cs (18)
137protected readonly RequestDelegate _noopApplication; 138protected readonly RequestDelegate _notImplementedApp; 139protected readonly RequestDelegate _readHeadersApplication; 140protected readonly RequestDelegate _readTrailersApplication; 141protected readonly RequestDelegate _bufferingApplication; 142protected readonly RequestDelegate _echoApplication; 143protected readonly RequestDelegate _echoWaitForAbortApplication; 144protected readonly RequestDelegate _largeHeadersApplication; 145protected readonly RequestDelegate _waitForAbortApplication; 146protected readonly RequestDelegate _waitForAbortFlushingApplication; 147protected readonly RequestDelegate _readRateApplication; 148protected readonly RequestDelegate _echoMethodNoBody; 149protected readonly RequestDelegate _echoHost; 150protected readonly RequestDelegate _echoPath; 151protected readonly RequestDelegate _appAbort; 152protected readonly RequestDelegate _appReset; 516protected void InitializeConnectionWithoutPreface(RequestDelegate application, bool addKestrelFeatures = false) 545protected async Task InitializeConnectionAsync(RequestDelegate application, int expectedSettingsCount = 4, bool expectedWindowUpdate = true, bool addKestrelFeatures = false)
Http3\Http3ConnectionTests.cs (1)
531var requestDelegate = sendData ? _echoApplication : _noopApplication;
Http3\Http3TestBase.cs (7)
29protected readonly RequestDelegate _noopApplication; 30protected readonly RequestDelegate _notImplementedApp; 31protected readonly RequestDelegate _echoApplication; 32protected readonly RequestDelegate _readRateApplication; 33protected readonly RequestDelegate _echoMethod; 34protected readonly RequestDelegate _echoPath; 35protected readonly RequestDelegate _echoHost;
HttpsConnectionMiddlewareTests.cs (1)
1280RequestDelegate app = context =>
ResponseTests.cs (1)
4533RequestDelegate handler,
src\Servers\Kestrel\shared\test\DummyApplication.cs (3)
14private readonly RequestDelegate _requestDelegate; 22public DummyApplication(RequestDelegate requestDelegate) 27public DummyApplication(RequestDelegate requestDelegate, IHttpContextFactory httpContextFactory)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
224public async Task InitializeConnectionAsync(RequestDelegate application) 263internal async ValueTask<Http3RequestStream> InitializeConnectionAndStreamsAsync(RequestDelegate application, IEnumerable<KeyValuePair<string, string>> headers, bool endStream = false)
TestTransport\TestServer.cs (6)
34private readonly RequestDelegate _app; 38public TestServer(RequestDelegate app) 43public TestServer(RequestDelegate app, TestServiceContext context) 49public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 54public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions) 69public TestServer(RequestDelegate app, TestServiceContext context, Action<KestrelServerOptions> configureKestrel, Action<IServiceCollection> configureServices)
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (2)
17var delegates = new Dictionary<string, RequestDelegate>(); 26RequestDelegate appfunc = null;
Interop.FunctionalTests (4)
Http2\Http2RequestTests.cs (1)
261private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null)
Http3\Http3RequestTests.cs (1)
2061private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null)
Http3\Http3TlsTests.cs (1)
516private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null)
HttpHelpers.cs (1)
66public static IHostBuilder CreateHostBuilder(Action<IServiceCollection> configureServices, RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null)
Microsoft.AspNetCore (8)
WebApplication.cs (4)
207internal RequestDelegate BuildRequestDelegate() => ApplicationBuilder.Build(); 208RequestDelegate IApplicationBuilder.Build() => BuildRequestDelegate(); 224public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
WebApplicationBuilder.cs (2)
519public RequestDelegate CreateMiddleware(RequestDelegate next)
WebHost.cs (2)
32public static IWebHost Start(RequestDelegate app) => 42public static IWebHost Start([StringSyntax(StringSyntaxAttribute.Uri)] string url, RequestDelegate app)
Microsoft.AspNetCore.Antiforgery (2)
AntiforgeryMiddleware.cs (2)
8internal sealed class AntiforgeryMiddleware(IAntiforgery antiforgery, RequestDelegate next) 10private readonly RequestDelegate _next = next;
Microsoft.AspNetCore.Antiforgery.Test (1)
AntiforgeryApplicationBuilderExtensionsTest.cs (1)
27var app = builder.Build();
Microsoft.AspNetCore.Authentication (2)
AuthenticationMiddleware.cs (2)
15private readonly RequestDelegate _next; 22public AuthenticationMiddleware(RequestDelegate next, IAuthenticationSchemeProvider schemes)
Microsoft.AspNetCore.Authentication.Test (6)
OpenIdConnect\OpenIdConnectEventTests.cs (3)
28private readonly RequestDelegate AppWritePath = context => context.Response.WriteAsync(context.Request.Path); 29private readonly RequestDelegate AppNotImpl = context => { throw new NotImplementedException("App"); }; 1264private TestServer CreateServer(OpenIdConnectEvents events, RequestDelegate appCode)
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (3)
28private readonly RequestDelegate AppWritePath = context => context.Response.WriteAsync(context.Request.Path); 29private readonly RequestDelegate AppNotImpl = context => { throw new NotImplementedException("App"); }; 1264private TestServer CreateServer(OpenIdConnectEvents events, RequestDelegate appCode)
Microsoft.AspNetCore.Authorization.Policy (7)
AuthorizationMiddleware.cs (5)
16RequestDelegate next, 36private readonly RequestDelegate _next; 47public AuthorizationMiddleware(RequestDelegate next, 62public AuthorizationMiddleware(RequestDelegate next, 76public AuthorizationMiddleware(RequestDelegate next,
AuthorizationMiddlewareResultHandler.cs (1)
15public Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
IAuthorizationMiddlewareResultHandler.cs (1)
23Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult);
Microsoft.AspNetCore.Authorization.Test (10)
AuthorizationAppBuilderExtensionsTests.cs (1)
25var appFunc = app.Build();
AuthorizationMiddlewareResultHandlerTests.cs (7)
17var requestDelegate = new Mock<RequestDelegate>(); 31var requestDelegate = new Mock<RequestDelegate>(); 45var requestDelegate = new Mock<RequestDelegate>(); 60var requestDelegate = new Mock<RequestDelegate>(); 84var requestDelegate = new Mock<RequestDelegate>(); 99var requestDelegate = new Mock<RequestDelegate>(); 123var requestDelegate = new Mock<RequestDelegate>();
AuthorizationMiddlewareTests.cs (2)
303var app = appBuilder.Build(); 994private AuthorizationMiddleware CreateMiddleware(RequestDelegate requestDelegate = null, IAuthorizationPolicyProvider policyProvider = null, IServiceProvider services = null, ILogger<AuthorizationMiddleware> logger = null)
Microsoft.AspNetCore.Components.Server (5)
Builder\ServerRazorComponentsEndpointConventionBuilderExtensions.cs (1)
55var original = b.RequestDelegate;
CircuitDisconnectMiddleware.cs (2)
19RequestDelegate next) 30public RequestDelegate Next { get; }
CircuitJavaScriptInitializationMiddleware.cs (1)
16public CircuitJavaScriptInitializationMiddleware(IOptions<CircuitOptions> options, RequestDelegate _)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
89var originalDelegate = c.RequestDelegate;
Microsoft.AspNetCore.Components.Server.Tests (4)
ComponentEndpointRouteBuilderExtensionsTest.cs (4)
26var app = applicationBuilder 45var app = applicationBuilder 65var app = applicationBuilder 105var app = applicationBuilder
Microsoft.AspNetCore.Components.WebAssembly.Server (4)
ComponentsWebAssemblyStaticAssetsEndpointConventionBuilderExtensions.cs (1)
39var original = endpoint.RequestDelegate;
ContentEncodingNegotiator.cs (2)
24private readonly RequestDelegate _next; 27public ContentEncodingNegotiator(RequestDelegate next, IWebHostEnvironment webHostEnvironment)
WebAssemblyRazorComponentsBuilderExtensions.cs (1)
75var app = applicationBuilder.Build();
Microsoft.AspNetCore.Components.WebAssembly.Server.Tests (9)
ContentEncodingNegotiatorTests.cs (9)
18RequestDelegate next = (ctx) => Task.CompletedTask; 40RequestDelegate next = (ctx) => Task.CompletedTask; 61RequestDelegate next = (ctx) => Task.CompletedTask; 84RequestDelegate next = (ctx) => Task.CompletedTask; 107RequestDelegate next = (ctx) => Task.CompletedTask; 130RequestDelegate next = (ctx) => Task.CompletedTask; 153RequestDelegate next = (ctx) => Task.CompletedTask; 175RequestDelegate next = (ctx) => Task.CompletedTask; 196RequestDelegate next = (ctx) => Task.CompletedTask;
Microsoft.AspNetCore.ConcurrencyLimiter (6)
ConcurrencyLimiterMiddleware.cs (4)
17private readonly RequestDelegate _next; 18private readonly RequestDelegate _onRejected; 24/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 28public ConcurrencyLimiterMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IQueuePolicy queue, IOptions<ConcurrencyLimiterOptions> options)
ConcurrencyLimiterOptions.cs (2)
15/// A <see cref="RequestDelegate"/> that handles requests rejected by this middleware. 18public RequestDelegate OnRejected { get; set; } = context =>
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (3)
QueueEmptyOverhead.cs (3)
18private RequestDelegate _restOfServer; 23_restOfServer = YieldsThreadInternally ? (RequestDelegate)YieldsThread : (RequestDelegate)CompletesImmediately;
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (6)
TestUtils.cs (6)
13public static ConcurrencyLimiterMiddleware CreateTestMiddleware(IQueuePolicy queue = null, RequestDelegate onRejected = null, RequestDelegate next = null) 28public static ConcurrencyLimiterMiddleware CreateTestMiddleware_QueuePolicy(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null) 37public static ConcurrencyLimiterMiddleware CreateTestMiddleware_StackPolicy(int maxConcurrentRequests, int requestQueueLimit, RequestDelegate onRejected = null, RequestDelegate next = null)
Microsoft.AspNetCore.CookiePolicy (3)
CookiePolicyMiddleware.cs (3)
26private readonly RequestDelegate _next; 35public CookiePolicyMiddleware(RequestDelegate next, IOptions<CookiePolicyOptions> options, ILoggerFactory factory) 47public CookiePolicyMiddleware(RequestDelegate next, IOptions<CookiePolicyOptions> options)
Microsoft.AspNetCore.CookiePolicy.Test (5)
CookieConsentTests.cs (1)
702private async Task<HttpContext> RunTestAsync(Action<CookiePolicyOptions> configureOptions, Action<HttpContext> configureRequest, RequestDelegate handleRequest)
CookiePolicyTests.cs (4)
21private readonly RequestDelegate SecureCookieAppends = context => 29private readonly RequestDelegate HttpCookieAppends = context => 37private readonly RequestDelegate SameSiteCookieAppends = context => 524RequestDelegate configureSetup,
Microsoft.AspNetCore.Cors (4)
Infrastructure\CorsMiddleware.cs (4)
19private readonly RequestDelegate _next; 30RequestDelegate next, 45RequestDelegate next, 68RequestDelegate next,
Microsoft.AspNetCore.Cors.Test (13)
CorsMiddlewareTests.cs (13)
386Mock.Of<RequestDelegate>(), 415Mock.Of<RequestDelegate>(), 652Mock.Of<RequestDelegate>(), 693Mock.Of<RequestDelegate>(), 723Mock.Of<RequestDelegate>(), 815Mock.Of<RequestDelegate>(), 850Mock.Of<RequestDelegate>(), 887Mock.Of<RequestDelegate>(), 920Mock.Of<RequestDelegate>(), 950Mock.Of<RequestDelegate>(), 977Mock.Of<RequestDelegate>(), 1002Mock.Of<RequestDelegate>(), 1026Mock.Of<RequestDelegate>(),
Microsoft.AspNetCore.Diagnostics (26)
DeveloperExceptionPage\DeveloperExceptionPageMiddleware.cs (2)
23/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 30RequestDelegate next,
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
33private readonly RequestDelegate _next; 46RequestDelegate next,
ExceptionHandler\ExceptionHandlerExtensions.cs (2)
83var exceptionHandlerPipeline = subAppBuilder.Build(); 130var newNext = RerouteHelper.Reroute(app, routeBuilder, next);
ExceptionHandler\ExceptionHandlerMiddleware.cs (2)
23/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 28RequestDelegate next,
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
24private readonly RequestDelegate _next; 34RequestDelegate next,
ExceptionHandler\ExceptionHandlerOptions.cs (2)
28/// The <see cref="RequestDelegate" /> that will handle the exception. If this is not 31public RequestDelegate? ExceptionHandler { get; set; }
src\Shared\Reroute.cs (2)
14internal static RequestDelegate Reroute(IApplicationBuilder app, object routeBuilder, RequestDelegate next)
StatusCodePage\StatusCodeContext.cs (4)
19/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 20public StatusCodeContext(HttpContext context, StatusCodePagesOptions options, RequestDelegate next) 38/// Gets the <see cref="RequestDelegate"/> representing the next middleware in the pipeline. 40public RequestDelegate Next { get; private set; }
StatusCodePage\StatusCodePagesExtensions.cs (3)
130var tangent = builder.Build(); 154var newNext = RerouteHelper.Reroute(app, routeBuilder, next); 163private static Func<StatusCodeContext, Task> CreateHandler(string pathFormat, string? queryFormat, RequestDelegate? next = null)
StatusCodePage\StatusCodePagesMiddleware.cs (3)
16private readonly RequestDelegate _next; 22/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 24public StatusCodePagesMiddleware(RequestDelegate next, IOptions<StatusCodePagesOptions> options)
WelcomePage\WelcomePageMiddleware.cs (2)
16private readonly RequestDelegate _next; 24public WelcomePageMiddleware(RequestDelegate next, IOptions<WelcomePageOptions> options)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (4)
DatabaseErrorPageMiddleware.cs (2)
38private readonly RequestDelegate _next; 53RequestDelegate next,
MigrationsEndPointMiddleware.cs (2)
21private readonly RequestDelegate _next; 32RequestDelegate next,
Microsoft.AspNetCore.Diagnostics.HealthChecks (3)
Builder\HealthCheckEndpointRouteBuilderExtensions.cs (1)
67var pipeline = endpoints.CreateApplicationBuilder()
HealthCheckMiddleware.cs (2)
15private readonly RequestDelegate _next; 23RequestDelegate next,
Microsoft.AspNetCore.Diagnostics.Tests (3)
ExceptionHandlerMiddlewareTest.cs (2)
492RequestDelegate exceptionHandler = null, 506RequestDelegate next,
ExceptionHandlerTest.cs (1)
47app.Run((RequestDelegate)(async (context) =>
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (3)
22private delegate (RequestDelegate RequestDelegate, List<object> Metadata) CreateRequestDelegate<TRequest, TResponse>( 148private (RequestDelegate RequestDelegate, List<object> Metadata) CreateUnaryRequestDelegate<TRequest, TResponse>( 175private (RequestDelegate RequestDelegate, List<object> Metadata) CreateServerStreamingRequestDelegate<TRequest, TResponse>(
Microsoft.AspNetCore.HeaderPropagation (2)
HeaderPropagationMiddleware.cs (2)
16private readonly RequestDelegate _next; 28public HeaderPropagationMiddleware(RequestDelegate next, IOptions<HeaderPropagationOptions> options, HeaderPropagationValues values)
Microsoft.AspNetCore.HeaderPropagation.Tests (2)
HeaderPropagationIntegrationTest.cs (1)
243public SimpleMiddleware(RequestDelegate next, IHttpClientFactory httpClientFactory)
HeaderPropagationMiddlewareTest.cs (1)
28public RequestDelegate Next { get; set; }
Microsoft.AspNetCore.HostFiltering (2)
HostFilteringMiddleware.cs (2)
27private readonly RequestDelegate _next; 38RequestDelegate next,
Microsoft.AspNetCore.Hosting (6)
GenericHost\GenericWebHostService.cs (1)
122RequestDelegate? application = null;
Internal\ErrorPageBuilder.cs (1)
14public static RequestDelegate BuildErrorPageApplication(
Internal\HostingApplication.cs (2)
15private readonly RequestDelegate _application; 21RequestDelegate application,
Internal\WebHost.cs (2)
132var application = BuildApplication(); 200private RequestDelegate BuildApplication()
Microsoft.AspNetCore.Hosting.Tests (7)
HostingMetricsTests.cs (1)
186ActivitySource activitySource = null, IMeterFactory meterFactory = null, RequestDelegate requestDelegate = null)
WebHostBuilderTests.cs (2)
1516private async Task AssertResponseContains(RequestDelegate app, string expectedText) 1571public RequestDelegate RequestDelegate { get; private set; }
WebHostTests.cs (4)
875var requestDelegate = new RequestDelegate(httpContext => 898var requestDelegate = new RequestDelegate(httpContext => 943var requestDelegate = new RequestDelegate(httpContext => 1088private IWebHost CreateHost(RequestDelegate requestDelegate)
Microsoft.AspNetCore.Hosting.WindowsServices.Tests (1)
WebHostServiceTests.cs (1)
50public RequestDelegate RequestDelegate { get; private set; }
Microsoft.AspNetCore.Http (14)
Builder\ApplicationBuilder.cs (11)
23private readonly List<Func<RequestDelegate, RequestDelegate>> _components = new(); 120public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware) 128private static string CreateMiddlewareDescription(Func<RequestDelegate, RequestDelegate> middleware) 161/// Produces a <see cref="RequestDelegate"/> that executes added middlewares. 163/// <returns>The <see cref="RequestDelegate"/>.</returns> 164public RequestDelegate Build() 166RequestDelegate app = context => 171var endpointRequestDelegate = endpoint?.RequestDelegate;
Timeouts\RequestTimeoutPolicy.cs (1)
30public RequestDelegate? WriteTimeoutResponse { get; init; }
Timeouts\RequestTimeoutsMiddleware.cs (2)
12private readonly RequestDelegate _next; 18RequestDelegate next,
Microsoft.AspNetCore.Http.Abstractions (37)
EndpointFilterFactoryContext.cs (1)
15/// The <see cref="MethodInfo"/> associated with the current route handler, <see cref="RequestDelegate"/> or MVC action.
Extensions\EndpointBuilder.cs (1)
23public RequestDelegate? RequestDelegate { get; set; }
Extensions\MapExtensions.cs (1)
62var branch = branchBuilder.Build();
Extensions\MapMiddleware.cs (2)
13private readonly RequestDelegate _next; 21public MapMiddleware(RequestDelegate next, MapOptions options)
Extensions\MapOptions.cs (1)
21public RequestDelegate? Branch { get; set; }
Extensions\MapWhenExtensions.cs (1)
32var branch = branchBuilder.Build();
Extensions\MapWhenMiddleware.cs (2)
13private readonly RequestDelegate _next; 21public MapWhenMiddleware(RequestDelegate next, MapWhenOptions options)
Extensions\MapWhenOptions.cs (1)
35public RequestDelegate? Branch { get; set; }
Extensions\RunExtensions.cs (1)
18public static void Run(this IApplicationBuilder app, RequestDelegate handler)
Extensions\UseExtensions.cs (4)
15/// If you aren't calling the next function, use <see cref="RunExtensions.Run(IApplicationBuilder, RequestDelegate)"/> instead. 17/// Prefer using <see cref="Use(IApplicationBuilder, Func{HttpContext, RequestDelegate, Task})"/> for better performance as shown below: 43/// If you aren't calling the next function, use <see cref="RunExtensions.Run(IApplicationBuilder, RequestDelegate)"/> instead. 48public static IApplicationBuilder Use(this IApplicationBuilder app, Func<HttpContext, RequestDelegate, Task> middleware)
Extensions\UseMiddlewareExtensions.cs (6)
125public RequestDelegate CreateMiddleware(RequestDelegate next) 133return (RequestDelegate)_invokeMethod.CreateDelegate(typeof(RequestDelegate), instance); 167public RequestDelegate CreateMiddleware(RequestDelegate next)
Extensions\UsePathBaseExtensions.cs (1)
37var newNext = RerouteHelper.Reroute(app, routeBuilder, next);
Extensions\UsePathBaseMiddleware.cs (2)
13private readonly RequestDelegate _next; 21public UsePathBaseMiddleware(RequestDelegate next, PathString pathBase)
Extensions\UseWhenExtensions.cs (1)
39var branch = branchBuilder.Build();
IApplicationBuilder.cs (3)
37IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware); 50RequestDelegate Build();
IMiddleware.cs (1)
17Task InvokeAsync(HttpContext context, RequestDelegate next);
Metadata\IEndpointMetadataProvider.cs (1)
19/// This method is called by RequestDelegateFactory when creating a <see cref="RequestDelegate"/> and by MVC when creating endpoints for controller actions.
Metadata\IEndpointParameterMetadataProvider.cs (1)
19/// This method is called by RequestDelegateFactory when creating a <see cref="RequestDelegate"/> and by MVC when creating endpoints for controller actions.
RequestDelegateResult.cs (2)
14public RequestDelegateResult(RequestDelegate requestDelegate, IReadOnlyList<object> metadata) 23public RequestDelegate RequestDelegate { get; }
Routing\Endpoint.cs (2)
25RequestDelegate? requestDelegate, 48public RequestDelegate? RequestDelegate { get; }
src\Shared\Reroute.cs (2)
14internal static RequestDelegate Reroute(IApplicationBuilder app, object routeBuilder, RequestDelegate next)
Microsoft.AspNetCore.Http.Abstractions.Tests (35)
MapPathMiddlewareTests.cs (10)
39var noMiddleware = new ApplicationBuilder(serviceProvider: null!).Build(); 59var app = builder.Build(); 89var app = builder.Build(); 117var app = builder.Build(); 148var app = builder.Build(); 170var app = builder.Build(); 188var app = builder.Build(); 264public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware) 270public RequestDelegate Build()
MapPredicateMiddlewareTests.cs (5)
49var noMiddleware = new ApplicationBuilder(serviceProvider: null!).Build(); 65var app = builder.Build(); 77var app = builder.Build(); 90var app = builder.Build(); 106var app = builder.Build();
UseMiddlewareTest.cs (17)
124var app = builder.Build(); 138var app = builder.Build(); 166var app = builder.Build(); 183var app = builder.Build(); 206var app = builder.Build(); 224public async Task InvokeAsync(HttpContext context, RequestDelegate next) 279public MiddlewareInjectWithOutAndRefParams(RequestDelegate next) { } 291public MiddlewareInjectInvokeNoService(RequestDelegate next) { } 298public MiddlewareInjectInvoke(RequestDelegate next) { } 305public MiddlewareNoParametersStub(RequestDelegate next) { } 312public MiddlewareAsyncNoParametersStub(RequestDelegate next) { } 319public MiddlewareNonTaskReturnStub(RequestDelegate next) { } 326public MiddlewareAsyncNonTaskReturnStub(RequestDelegate next) { } 333public MiddlewareNoInvokeStub(RequestDelegate next) { } 338public MiddlewareMultipleInvokesStub(RequestDelegate next) { } 347public MiddlewareMultipleInvokeAsyncStub(RequestDelegate next) { } 356public MiddlewareMultipleInvokeAndInvokeAsyncStub(RequestDelegate next) { }
UsePathBaseExtensionsTests.cs (3)
41public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware) 55public RequestDelegate Build() => _wrappedBuilder.Build();
Microsoft.AspNetCore.Http.Connections (2)
ConnectionEndpointRouteBuilderExtensions.cs (2)
100var negotiateHandler = app.Build(); 112var executehandler = app.Build();
Microsoft.AspNetCore.Http.Extensions (16)
RequestDelegateFactory.cs (13)
35/// Creates <see cref="RequestDelegate"/> implementations from <see cref="Delegate"/> request handlers. 135/// Returns metadata inferred automatically for the <see cref="RequestDelegate"/> created by <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>. 154/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="handler"/>. 165/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="handler"/>. 192RequestDelegate finalRequestDelegate = targetableRequestDelegate switch 196null => (RequestDelegate)handler, 204/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>. 209/// <returns>The <see cref="RequestDelegate"/>.</returns> 216/// Creates a <see cref="RequestDelegate"/> implementation for <paramref name="methodInfo"/>. 227/// <returns>The <see cref="RequestDelegate"/>.</returns> 239RequestDelegate finalRequestDelegate; 298private static RequestDelegateResult CreateRequestDelegateResult(RequestDelegate finalRequestDelegate, EndpointBuilder endpointBuilder) 373if (filterPipeline is null && factoryContext.Handler is RequestDelegate)
RequestDelegateFactoryOptions.cs (2)
11/// Options for controlling the behavior of the <see cref="RequestDelegate" /> when created using <see cref="RequestDelegateFactory" />. 26/// Controls whether the <see cref="RequestDelegate"/> should throw a <see cref="BadHttpRequestException"/> in addition to
RequestDelegateMetadataResult.cs (1)
15/// Gets endpoint metadata inferred from creating the <see cref="RequestDelegate" />. If a non-null
Microsoft.AspNetCore.Http.Extensions.Tests (55)
RequestDelegateFactoryTests.cs (44)
118var requestDelegate = factoryResult.RequestDelegate; 139var requestDelegate = factoryResult.RequestDelegate; 185var requestDelegate = factoryResult.RequestDelegate; 260var requestDelegate = factoryResult.RequestDelegate; 274var requestDelegate = factoryResult.RequestDelegate; 589var requestDelegate = factoryResult.RequestDelegate; 616var requestDelegate = factoryResult.RequestDelegate; 650var requestDelegate = factoryResult.RequestDelegate; 678var requestDelegate = factoryResult.RequestDelegate; 701var requestDelegate = resultFactory.RequestDelegate; 759var requestDelegate = factoryResult.RequestDelegate; 873var requestDelegate = factoryResult.RequestDelegate; 892var requestDelegate = factoryResult.RequestDelegate; 1140var requestDelegate = factoryResult.RequestDelegate; 1185var requestDelegate = factoryResult.RequestDelegate; 1205var requestDelegate = factoryResult.RequestDelegate; 1229var requestDelegate = factoryResult.RequestDelegate; 1250var requestDelegate = factoryResult.RequestDelegate; 1270var requestDelegate = factoryResult.RequestDelegate; 1290var requestDelegate = factoryResult.RequestDelegate; 1350var requestDelegate = factoryResult.RequestDelegate; 1383var requestDelegate = factoryResult.RequestDelegate; 1479var requestDelegate = factoryResult.RequestDelegate; 1518var requestDelegate = factoryResult.RequestDelegate; 1572var requestDelegate = factoryResult.RequestDelegate; 1672var requestDelegate = factoryResult.RequestDelegate; 1749var requestDelegate = factoryResult.RequestDelegate; 1784var requestDelegate = factoryResult.RequestDelegate; 1814var requestDelegate = factoryResult.RequestDelegate; 1845var requestDelegate = factoryResult.RequestDelegate; 1872var requestDelegate = factoryResult.RequestDelegate; 1911var requestDelegate = factoryResult.RequestDelegate; 1940var requestDelegate = factoryResult.RequestDelegate; 1973var requestDelegate = factoryResult.RequestDelegate; 2176var requestDelegate = factoryResult.RequestDelegate; 2219var requestDelegate = factoryResult.RequestDelegate; 2291var requestDelegate = factoryResult.RequestDelegate; 2386var requestDelegate = factoryResult.RequestDelegate; 2421var requestDelegate = factoryResult.RequestDelegate; 2505var requestDelegate = factoryResult.RequestDelegate; 3040RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 3068RequestDelegate requestDelegate = static context => Task.CompletedTask; 3137var requestDelegate = factoryResult.RequestDelegate; 3186var requestDelegate = factoryResult.RequestDelegate;
RequestDelegateFactoryTests.FormMapping.cs (7)
55var requestDelegate = factoryResult.RequestDelegate; 102var requestDelegate = factoryResult.RequestDelegate; 150var requestDelegate = factoryResult.RequestDelegate; 197var requestDelegate = factoryResult.RequestDelegate; 230var requestDelegate = factoryResult.RequestDelegate; 278var requestDelegate = factoryResult.RequestDelegate; 300var requestDelegate = factoryResult.RequestDelegate;
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (1)
329var requestDelegate = factoryResult.RequestDelegate;
RequestDelegateGenerator\RequestDelegateCreationTests.RouteParameter.cs (2)
204var requestDelegate = endpoint.RequestDelegate; 228var requestDelegate = endpoint.RequestDelegate;
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (1)
258var requestDelegate = endpoint.RequestDelegate;
Microsoft.AspNetCore.Http.Tests (8)
ApplicationBuilderTests.cs (7)
17var app = builder.Build(); 29var app = builder.Build(); 54var app = builder.Build(); 87var app = builder.Build(); 113builder.Use((HttpContext context, RequestDelegate next) => 118var app = builder.Build(); 136var app = builder.Build();
Timeouts\RequestTimeoutsMiddlewareTests.cs (1)
276RequestDelegate requestDelegate = null,
Microsoft.AspNetCore.HttpLogging (4)
HttpLoggingMiddleware.cs (2)
18private readonly RequestDelegate _next; 26public HttpLoggingMiddleware(RequestDelegate next, IOptionsMonitor<HttpLoggingOptions> options, ILogger<HttpLoggingMiddleware> logger,
W3CLoggingMiddleware.cs (2)
19private readonly RequestDelegate _next; 53public W3CLoggingMiddleware(RequestDelegate next, IOptionsMonitor<W3CLoggerOptions> options, W3CLogger w3cLogger)
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (1)
1975private HttpLoggingMiddleware CreateMiddleware(RequestDelegate app = null,
HttpLoggingServicesExtensionsTests.cs (1)
60var app = appBuilder.Build();
Microsoft.AspNetCore.HttpOverrides (8)
CertificateForwardingMiddleware.cs (2)
17private readonly RequestDelegate _next; 28RequestDelegate next,
ForwardedHeadersMiddleware.cs (3)
22private readonly RequestDelegate _next; 43/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 46public ForwardedHeadersMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IOptions<ForwardedHeadersOptions> options)
HttpMethodOverrideMiddleware.cs (3)
16private readonly RequestDelegate _next; 22/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 24public HttpMethodOverrideMiddleware(RequestDelegate next, IOptions<HttpMethodOverrideOptions> options)
Microsoft.AspNetCore.HttpsPolicy (6)
HstsMiddleware.cs (3)
22private readonly RequestDelegate _next; 33public HstsMiddleware(RequestDelegate next, IOptions<HstsOptions> options, ILoggerFactory loggerFactory) 54public HstsMiddleware(RequestDelegate next, IOptions<HstsOptions> options)
HttpsRedirectionMiddleware.cs (3)
21private readonly RequestDelegate _next; 36public HttpsRedirectionMiddleware(RequestDelegate next, IOptions<HttpsRedirectionOptions> options, IConfiguration config, ILoggerFactory loggerFactory) 66public HttpsRedirectionMiddleware(RequestDelegate next, IOptions<HttpsRedirectionOptions> options, IConfiguration config, ILoggerFactory loggerFactory,
Microsoft.AspNetCore.Localization (3)
RequestLocalizationMiddleware.cs (3)
22private readonly RequestDelegate _next; 29/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 33public RequestLocalizationMiddleware(RequestDelegate next, IOptions<RequestLocalizationOptions> options, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.MiddlewareAnalysis (5)
AnalysisBuilder.cs (3)
49public RequestDelegate Build() 63public IApplicationBuilder Use(Func<RequestDelegate, RequestDelegate> middleware)
AnalysisMiddleware.cs (2)
16private readonly RequestDelegate _next; 29public AnalysisMiddleware(RequestDelegate next, DiagnosticSource diagnosticSource, string middlewareName)
Microsoft.AspNetCore.Mvc.Core (16)
Filters\MiddlewareFilter.cs (2)
13private readonly RequestDelegate _middlewarePipeline; 15public MiddlewareFilter(RequestDelegate middlewarePipeline)
Filters\MiddlewareFilterAttribute.cs (1)
44var pipeline = middlewarePipelineService.GetPipeline(ConfigurationType);
Filters\MiddlewareFilterBuilder.cs (5)
20private readonly ConcurrentDictionary<Type, Lazy<RequestDelegate>> _pipelinesCache 21= new ConcurrentDictionary<Type, Lazy<RequestDelegate>>(); 31public RequestDelegate GetPipeline(Type configurationType) 37key => new Lazy<RequestDelegate>(() => BuildPipeline(key))); 42private RequestDelegate BuildPipeline(Type middlewarePipelineProviderType)
Routing\ActionEndpointFactory.cs (6)
22private readonly RequestDelegate _requestDelegate; 101var requestDelegate = CreateRequestDelegate(action, route.DataTokens) ?? _requestDelegate; 129var requestDelegate = CreateRequestDelegate(action) ?? _requestDelegate; 500private RequestDelegate? CreateRequestDelegate(ActionDescriptor action, RouteValueDictionary? dataTokens = null) 504var requestDelegate = factory.CreateRequestDelegate(action, dataTokens); 514private static RequestDelegate CreateRequestDelegate()
Routing\ControllerRequestDelegateFactory.cs (1)
60public RequestDelegate? CreateRequestDelegate(ActionDescriptor actionDescriptor, RouteValueDictionary? dataTokens)
Routing\IRequestDelegateFactory.cs (1)
15RequestDelegate? CreateRequestDelegate(ActionDescriptor actionDescriptor, RouteValueDictionary? dataTokens);
Microsoft.AspNetCore.Mvc.Core.Test (10)
Filters\MiddlewareFilterBuilderTest.cs (7)
35var pipeline = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 60var pipeline1 = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 67var pipeline2 = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 96var pipeline = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 147var pipeline = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 209var pipeline = pipelineBuilderService.GetPipeline(typeof(Pipeline1)); 277var pipeline = pipelineBuilderService.GetPipeline(typeof(Pipeline1));
Filters\MiddlewareFilterTest.cs (1)
319private RequestDelegate GetMiddlewarePipeline(Type middlewarePipelineProviderType)
Routing\ActionEndpointFactoryTest.cs (1)
265RequestDelegate del = context => Task.CompletedTask;
Routing\AttributeRouteTest.cs (1)
19private static readonly RequestDelegate NullHandler = (c) => Task.FromResult(0);
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\CultureReplacerMiddleware.cs (2)
15private readonly RequestDelegate _next; 20public CultureReplacerMiddleware(RequestDelegate next, TestCulture culture)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageRequestDelegateFactory.cs (1)
71public RequestDelegate? CreateRequestDelegate(ActionDescriptor actionDescriptor, RouteValueDictionary? dataTokens)
Microsoft.AspNetCore.OutputCaching (4)
OutputCacheMiddleware.cs (4)
22private readonly RequestDelegate _next; 33/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 39RequestDelegate next, 55RequestDelegate next,
Microsoft.AspNetCore.OutputCaching.Tests (5)
TestUtils.cs (5)
106return CreateBuildersWithOutputCaching(configureDelegate, options, new RequestDelegate[] 134IEnumerable<RequestDelegate>? requestDelegates = null) 142requestDelegates = new RequestDelegate[] 150foreach (var requestDelegate in requestDelegates) 189RequestDelegate? next = null,
Microsoft.AspNetCore.Owin (5)
OwinExtensions.cs (5)
36Func<RequestDelegate, RequestDelegate> middleware1 = next1 => 123private static CreateMiddleware CreateMiddlewareFactory(Func<RequestDelegate, RequestDelegate> middleware, IServiceProvider services) 127var app = middleware(httpContext =>
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
17private readonly RequestDelegate _next; 30/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 35public RateLimitingMiddleware(RequestDelegate next, ILogger<RateLimitingMiddleware> logger, IOptions<RateLimiterOptions> options, IServiceProvider serviceProvider, RateLimitingMetrics metrics)
Microsoft.AspNetCore.RateLimiting.Tests (3)
RateLimitingApplicationBuilderExtensionsTests.cs (2)
59var app = appBuilder.Build(); 76var app = appBuilder.Build();
RateLimitingMetricsTests.cs (1)
335private RateLimitingMiddleware CreateTestRateLimitingMiddleware(IOptions<RateLimiterOptions> options, ILogger<RateLimitingMiddleware> logger = null, IServiceProvider serviceProvider = null, IMeterFactory meterFactory = null, RequestDelegate next = null)
Microsoft.AspNetCore.RequestDecompression (2)
RequestDecompressionMiddleware.cs (2)
16private readonly RequestDelegate _next; 27RequestDelegate next,
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionMiddlewareTests.cs (1)
600RequestDelegate requestDelegate = null;
Microsoft.AspNetCore.ResponseCaching (4)
ResponseCachingMiddleware.cs (4)
25private readonly RequestDelegate _next; 35/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 40RequestDelegate next, 58RequestDelegate next,
Microsoft.AspNetCore.ResponseCaching.Tests (5)
TestUtils.cs (5)
121return CreateBuildersWithResponseCaching(configureDelegate, options, new RequestDelegate[] 144IEnumerable<RequestDelegate> requestDelegates = null) 152requestDelegates = new RequestDelegate[] 159foreach (var requestDelegate in requestDelegates) 190RequestDelegate next = null,
Microsoft.AspNetCore.ResponseCompression (2)
ResponseCompressionMiddleware.cs (2)
15private readonly RequestDelegate _next; 23public ResponseCompressionMiddleware(RequestDelegate next, IResponseCompressionProvider provider)
Microsoft.AspNetCore.Rewrite (6)
RewriteBuilderExtensions.cs (1)
60var newNext = RerouteHelper.Reroute(app, routeBuilder, next);
RewriteMiddleware.cs (2)
20private readonly RequestDelegate _next; 33RequestDelegate next,
RewriteOptions.cs (1)
28internal RequestDelegate? BranchedNext { get; set; }
src\Shared\Reroute.cs (2)
14internal static RequestDelegate Reroute(IApplicationBuilder app, object routeBuilder, RequestDelegate next)
Microsoft.AspNetCore.Routing (48)
Builder\EndpointRouteBuilderExtensions.cs (11)
68RequestDelegate requestDelegate) 84RequestDelegate requestDelegate) 100RequestDelegate requestDelegate) 116RequestDelegate requestDelegate) 132RequestDelegate requestDelegate) 150RequestDelegate requestDelegate) 168RequestDelegate requestDelegate) 184RequestDelegate requestDelegate) 192RequestDelegate requestDelegate, 205var requestDelegate = (RequestDelegate)handler;
Builder\FallbackEndpointRouteBuilderExtensions.cs (5)
29/// <see cref="MapFallback(IEndpointRouteBuilder, RequestDelegate)"/> is intended to handle cases where URL path of 35/// <see cref="MapFallback(IEndpointRouteBuilder, RequestDelegate)"/> registers an endpoint using the pattern 39public static IEndpointConventionBuilder MapFallback(this IEndpointRouteBuilder endpoints, RequestDelegate requestDelegate) 57/// <see cref="MapFallback(IEndpointRouteBuilder, string, RequestDelegate)"/> is intended to handle cases where no 71RequestDelegate requestDelegate)
EndpointMiddleware.cs (2)
20private readonly RequestDelegate _next; 25RequestDelegate next,
EndpointRoutingMiddleware.cs (2)
30private readonly RequestDelegate _next; 42RequestDelegate next)
RequestDelegateFilterPipelineBuilder.cs (2)
17public static RequestDelegate Create(RequestDelegate requestDelegate, RequestDelegateFactoryOptions options)
RequestDelegateRouteBuilderExtensions.cs (13)
23/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 25public static IRouteBuilder MapRoute(this IRouteBuilder builder, [StringSyntax("Route")] string template, RequestDelegate handler) 60/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 62public static IRouteBuilder MapDelete(this IRouteBuilder builder, [StringSyntax("Route")] string template, RequestDelegate handler) 102/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 104public static IRouteBuilder MapGet(this IRouteBuilder builder, [StringSyntax("Route")] string template, RequestDelegate handler) 144/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 146public static IRouteBuilder MapPost(this IRouteBuilder builder, [StringSyntax("Route")] string template, RequestDelegate handler) 186/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 188public static IRouteBuilder MapPut(this IRouteBuilder builder, [StringSyntax("Route")] string template, RequestDelegate handler) 237RequestDelegate requestDelegate = (httpContext) => 252/// <param name="handler">The <see cref="RequestDelegate"/> route handler.</param> 258RequestDelegate handler)
RouteEndpoint.cs (1)
25RequestDelegate requestDelegate,
RouteEndpointBuilder.cs (1)
36RequestDelegate? requestDelegate,
RouteEndpointDataSource.cs (5)
29RequestDelegate requestDelegate, 158RequestDelegate? factoryCreatedRequestDelegate = isRouteHandler ? null : (RequestDelegate)entry.RouteHandler; 161RequestDelegate redirectRequestDelegate = context => 236var conventionOverriddenRequestDelegate = ReferenceEquals(builder.RequestDelegate, redirectRequestDelegate) ? null : builder.RequestDelegate;
RouteHandler.cs (3)
15private readonly RequestDelegate _requestDelegate; 21public RouteHandler(RequestDelegate requestDelegate) 27public RequestDelegate GetRequestHandler(HttpContext httpContext, RouteData routeData)
RouterMiddleware.cs (2)
16private readonly RequestDelegate _next; 26RequestDelegate next,
ShortCircuit\RouteShortCircuitEndpointRouteBuilderExtensions.cs (1)
14private static readonly RequestDelegate _shortCircuitDelegate = (context) => Task.CompletedTask;
Microsoft.AspNetCore.Routing.Abstractions (4)
IRouteHandler.cs (3)
14/// Gets a <see cref="RequestDelegate"/> to handle the request, based on the provided 20/// A <see cref="RequestDelegate"/>, or <c>null</c> if the handler cannot handle this request. 22RequestDelegate GetRequestHandler(HttpContext httpContext, RouteData routeData);
RouteContext.cs (1)
30public RequestDelegate? Handler { get; set; }
Microsoft.AspNetCore.Routing.FunctionalTests (1)
EndpointRoutingIntegrationTest.cs (1)
18private static readonly RequestDelegate TestDelegate = async context => await Task.Yield();
Microsoft.AspNetCore.Routing.Tests (74)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (6)
65var appFunc = app.Build(); 97var appFunc = app.Build(); 161var appFunc = app.Build(); 206var requestDelegate = app.Build(); 271var requestDelegate = app.Build(); 317var requestDelegate = app.Build();
Builder\FallbackEndpointRouteBuilderExtensionsTest.cs (2)
21RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 37RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask;
Builder\GroupTest.cs (1)
272var originalRequestDelegate = builder.RequestDelegate!;
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (27)
34IEndpointConventionBuilder MapGet(IEndpointRouteBuilder routes, string template, RequestDelegate action) => 37IEndpointConventionBuilder MapPost(IEndpointRouteBuilder routes, string template, RequestDelegate action) => 40IEndpointConventionBuilder MapPut(IEndpointRouteBuilder routes, string template, RequestDelegate action) => 43IEndpointConventionBuilder MapDelete(IEndpointRouteBuilder routes, string template, RequestDelegate action) => 46IEndpointConventionBuilder Map(IEndpointRouteBuilder routes, string template, RequestDelegate action) => 51new object[] { (Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder>)MapGet }, 52new object[] { (Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder>)MapPost }, 53new object[] { (Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder>)MapPut }, 54new object[] { (Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder>)MapDelete }, 55new object[] { (Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder>)Map }, 65RequestDelegate requestDelegate = (d) => Task.CompletedTask; 80public async Task MapEndpoint_ReturnGenericTypeTask_GeneratedDelegate(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 102var requestDelegate = endpoint.RequestDelegate!; 112public async Task MapEndpoint_CanBeFiltered_EndpointFilterFactory(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 119RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 138var requestDelegate = endpoint.RequestDelegate!; 154RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 166var requestDelegate = endpoint.RequestDelegate!; 184RequestDelegate initialRequestDelegate = static (context) => 217var requestDelegate = endpoint.RequestDelegate!; 268RequestDelegate requestDelegate = (HttpContext context) => Task.CompletedTask; 327public void MapEndpoint_UsesOriginalRequestDelegateInstance_IfFilterDoesNotChangePerRequestBehavior(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 331RequestDelegate initialRequestDelegate = static (context) => Task.CompletedTask; 352RequestDelegate requestDelegate = (d) => Task.CompletedTask; 388Expression<RequestDelegate> handler = context => Task.CompletedTask; 431public void Map_EndpointMetadataNotDuplicated(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map) 454public void AddingMetadataAfterBuildingEndpointThrows(Func<IEndpointRouteBuilder, string, RequestDelegate, IEndpointConventionBuilder> map)
Builder\RoutingBuilderExtensionsTest.cs (2)
85var appFunc = app.Build(); 113var appFunc = app.Build();
EndpointMiddlewareTest.cs (20)
26RequestDelegate next = (c) => 50RequestDelegate next = (c) => 73RequestDelegate endpointFunc = (c) => 81RequestDelegate next = (c) => 108RequestDelegate throwIfCalled = (c) => 137RequestDelegate throwIfCalled = (c) => 163RequestDelegate endpointFunc = (c) => 173RequestDelegate next = (c) => 197RequestDelegate endpointFunc = (c) => 207RequestDelegate next = (c) => 234RequestDelegate throwIfCalled = (c) => 260RequestDelegate endpointFunc = (c) => 270RequestDelegate next = (c) => 294RequestDelegate endpointFunc = (c) => 304RequestDelegate next = (c) => 332RequestDelegate throwIfCalled = (c) => 358RequestDelegate endpointFunc = (c) => 368RequestDelegate next = (c) => 392RequestDelegate endpointFunc = (c) => 402RequestDelegate next = (c) =>
EndpointRoutingMiddlewareFormOptionsTest.cs (1)
208RequestDelegate next = null)
EndpointRoutingMiddlewareTest.cs (2)
417var requestDelegate = applicationBuilder.Build(); 468RequestDelegate next = null)
RequestDelegateRouteBuilderExtensionsTest.cs (1)
15private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask;
RouteCollectionTest.cs (1)
15private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask;
RouteEndpointBuilderTest.cs (3)
32RequestDelegate requestDelegate = (d) => null; 55RequestDelegate requestDelegate = (d) => null; 147RequestDelegate requestDelegate = (d) =>
RouterMiddlewareTest.cs (3)
79RequestDelegate next = (c) => 110RequestDelegate next = (c) => 142context.Handler = _isHandled ? (RequestDelegate)((c) => Task.CompletedTask) : null;
RouteTest.cs (1)
21private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask;
RoutingMetricsTests.cs (1)
155RequestDelegate next = null)
TestConstants.cs (2)
10internal static readonly RequestDelegate EmptyRequestDelegate = (context) => Task.CompletedTask; 11internal static readonly RequestDelegate ShortCircuitRequestDelegate = (context) =>
Tree\TreeRouterTest.cs (1)
19private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (13)
DummyApplication.cs (2)
14private readonly RequestDelegate _requestDelegate; 18public DummyApplication(RequestDelegate requestDelegate)
RequestTests.cs (1)
570private IServer CreateServer(out string root, RequestDelegate app)
Utilities.cs (10)
43internal static IServer CreateHttpServer(out string baseAddress, RequestDelegate app, ILoggerFactory loggerFactory) 49internal static IServer CreateHttpServer(out string baseAddress, RequestDelegate app, Action<HttpSysOptions> configureOptions, ILoggerFactory loggerFactory) 55internal static IServer CreateHttpServerReturnRoot(string path, out string root, RequestDelegate app, ILoggerFactory loggerFactory) 61internal static IServer CreateHttpAuthServer(AuthenticationSchemes authType, bool allowAnonymous, out string baseAddress, RequestDelegate app, ILoggerFactory loggerFactory) 71internal static IHost CreateDynamicHost(AuthenticationSchemes authType, bool allowAnonymous, out string root, RequestDelegate app, ILoggerFactory loggerFactory) 80internal static IHost CreateDynamicHost(out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory) 85internal static IHost CreateDynamicHost(string basePath, out string root, out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory) 124internal static IServer CreateDynamicHttpServer(string basePath, out string root, out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory) 139internal static IServer CreateDynamicHttpsServer(out string baseAddress, RequestDelegate app, ILoggerFactory loggerFactory) 144internal static IServer CreateDynamicHttpsServer(string basePath, out string root, out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory = null)
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (4)
DummyApplication.cs (2)
12private readonly RequestDelegate _requestDelegate; 16public DummyApplication(RequestDelegate requestDelegate)
Utilities.cs (2)
27internal static IServer CreateHttpServer(out string baseAddress, RequestDelegate app) 43internal static IServer CreateDynamicHttpServer(string basePath, out string root, out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app)
Microsoft.AspNetCore.Server.IISIntegration (3)
IISMiddleware.cs (3)
31private readonly RequestDelegate _next; 48public IISMiddleware(RequestDelegate next, 68public IISMiddleware(RequestDelegate next,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
src\Servers\Kestrel\shared\test\DummyApplication.cs (3)
14private readonly RequestDelegate _requestDelegate; 22public DummyApplication(RequestDelegate requestDelegate) 27public DummyApplication(RequestDelegate requestDelegate, IHttpContextFactory httpContextFactory)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (9)
InMemoryTransportBenchmark.cs (2)
242private readonly RequestDelegate _next; 244public PlaintextMiddleware(RequestDelegate next)
NamedPipesTransportBenchmark.cs (2)
140private readonly RequestDelegate _next; 142public PlaintextMiddleware(RequestDelegate next)
src\Servers\Kestrel\shared\test\DummyApplication.cs (3)
14private readonly RequestDelegate _requestDelegate; 22public DummyApplication(RequestDelegate requestDelegate) 27public DummyApplication(RequestDelegate requestDelegate, IHttpContextFactory httpContextFactory)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
224public async Task InitializeConnectionAsync(RequestDelegate application) 263internal async ValueTask<Http3RequestStream> InitializeConnectionAndStreamsAsync(RequestDelegate application, IEnumerable<KeyValuePair<string, string>> headers, bool endStream = false)
Microsoft.AspNetCore.Session (3)
SessionMiddleware.cs (3)
21private readonly RequestDelegate _next; 30/// <param name="next">The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.</param> 36RequestDelegate next,
Microsoft.AspNetCore.SpaProxy (2)
SpaProxyMiddleware.cs (2)
24private readonly RequestDelegate _next; 31RequestDelegate next,
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\ConditionalProxyMiddleware.cs (2)
16private readonly RequestDelegate _next; 24RequestDelegate next,
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
32var original = builder.RequestDelegate!;
Microsoft.AspNetCore.StaticFiles (9)
DefaultFilesMiddleware.cs (2)
21private readonly RequestDelegate _next; 30public DefaultFilesMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DefaultFilesOptions> options)
DirectoryBrowserMiddleware.cs (3)
20private readonly RequestDelegate _next; 30public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<DirectoryBrowserOptions> options) 42public DirectoryBrowserMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, HtmlEncoder encoder, IOptions<DirectoryBrowserOptions> options)
StaticFileContext.cs (1)
304public async Task ServeStaticFile(HttpContext context, RequestDelegate next)
StaticFileMiddleware.cs (2)
20private readonly RequestDelegate _next; 32public StaticFileMiddleware(RequestDelegate next, IWebHostEnvironment hostingEnv, IOptions<StaticFileOptions> options, ILoggerFactory loggerFactory)
StaticFilesEndpointRouteBuilderExtensions.cs (1)
180private static RequestDelegate CreateRequestDelegate(
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
382RequestDelegate handler = async (ctx) =>
Microsoft.AspNetCore.TestHost.Tests (30)
ClientHandlerTests.cs (2)
597RequestDelegate _application; 599public DummyApplication(RequestDelegate application)
RequestLifetimeTests.cs (1)
97private Task<IHost> CreateHost(RequestDelegate appDelegate)
ResponseBodyTests.cs (1)
157private Task<IHost> CreateHost(RequestDelegate appDelegate)
ResponseResetTests.cs (1)
160private Task<IHost> CreateHost(RequestDelegate appDelegate)
TestClientTests.cs (22)
27RequestDelegate appDelegate = ctx => 45RequestDelegate appDelegate = ctx => 67RequestDelegate appDelegate = ctx => 88RequestDelegate appDelegate = async ctx => 109RequestDelegate appDelegate = async ctx => 136RequestDelegate app = async ctx => 173RequestDelegate appDelegate = async ctx => 243RequestDelegate appDelegate = ctx => 271RequestDelegate appDelegate = async ctx => 349RequestDelegate appDelegate = async ctx => 410RequestDelegate appDelegate = async ctx => 458RequestDelegate appDelegate = ctx => 506RequestDelegate appDelegate = async ctx => 578RequestDelegate appDelegate = async ctx => 647RequestDelegate appDelegate = async ctx => 701RequestDelegate appDelegate = async ctx => 758RequestDelegate appDelegate = async ctx => 785RequestDelegate appDelegate = async ctx => 830RequestDelegate appDelegate = async ctx => 944RequestDelegate appDelegate = async ctx => 970RequestDelegate appDelegate = async ctx => 997RequestDelegate appDelegate = async ctx =>
TestServerTests.cs (3)
394private RequestDelegate _next; 396public TestRequestServiceMiddleware(RequestDelegate next) 783RequestDelegate appDelegate = ctx =>
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
1984var branch = newBuilder.Build(); 2704Assert.DoesNotContain(nameof(RequestDelegate), m); 2843public Task InvokeAsync(HttpContext context, RequestDelegate next) 2908app.Use((HttpContext context, RequestDelegate next) =>
Microsoft.AspNetCore.WebSockets (2)
WebSocketMiddleware.cs (2)
23private readonly RequestDelegate _next; 35public WebSocketMiddleware(RequestDelegate next, IOptions<WebSocketOptions> options, ILoggerFactory loggerFactory)
RoutingSandbox (5)
Framework\FrameworkConfigurationBuilder.cs (1)
27public void AddHubMethod(string hub, string method, RequestDelegate requestDelegate)
Framework\FrameworkEndpointDataSource.cs (1)
92public RequestDelegate RequestDelegate { get; set; }
HelloExtension\EndpointRouteBuilderExtensions.cs (1)
12var pipeline = endpoints.CreateApplicationBuilder()
HelloExtension\HelloMiddleware.cs (2)
11private readonly RequestDelegate _next; 15public HelloMiddleware(RequestDelegate next, IOptions<HelloOptions> helloOptions)
RoutingWebSite (3)
HelloExtension\EndpointRouteBuilderExtensions.cs (1)
12var pipeline = endpoints.CreateApplicationBuilder()
HelloExtension\HelloMiddleware.cs (2)
11private readonly RequestDelegate _next; 15public HelloMiddleware(RequestDelegate next, IOptions<HelloOptions> helloOptions)
Sockets.BindTests (7)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (7)
34private readonly RequestDelegate _app; 36public TestServer(RequestDelegate app) 41public TestServer(RequestDelegate app, TestServiceContext context) 46public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 51public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions, Action<IServiceCollection> configureServices = null) 67public TestServer(RequestDelegate app, TestServiceContext context, Action<KestrelServerOptions> configureKestrel) 72public TestServer(RequestDelegate app, TestServiceContext context, Action<KestrelServerOptions> configureKestrel, Action<IServiceCollection> configureServices)
Sockets.FunctionalTests (7)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (7)
34private readonly RequestDelegate _app; 36public TestServer(RequestDelegate app) 41public TestServer(RequestDelegate app, TestServiceContext context) 46public TestServer(RequestDelegate app, TestServiceContext context, ListenOptions listenOptions) 51public TestServer(RequestDelegate app, TestServiceContext context, Action<ListenOptions> configureListenOptions, Action<IServiceCollection> configureServices = null) 67public TestServer(RequestDelegate app, TestServiceContext context, Action<KestrelServerOptions> configureKestrel) 72public TestServer(RequestDelegate app, TestServiceContext context, Action<KestrelServerOptions> configureKestrel, Action<IServiceCollection> configureServices)