161 references to GetEndpoint
CookieSample (1)
Program.cs (1)
24var authData = context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<IAuthorizeData>();
Microsoft.AspNetCore.Antiforgery (3)
AntiforgeryMiddleware.cs (1)
18var endpoint = context.GetEndpoint();
src\Shared\HttpExtensions.cs (2)
38var endpoint = context.GetEndpoint(); 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationMiddleware.cs (1)
97var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Authorization.Test (1)
AuthorizationMiddlewareTests.cs (1)
671Assert.Equal(endpoint, resource.GetEndpoint());
Microsoft.AspNetCore.Components.Endpoints (8)
Assets\ImportMap.cs (1)
52_computedImportMapDefinition = ImportMapDefinition ?? HttpContext?.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>();
Builder\RazorComponentsEndpointHttpContextExtensions.cs (1)
33var pageType = context.GetEndpoint()?.Metadata.GetMetadata<ComponentTypeMetadata>()?.Type;
RazorComponentEndpointInvoker.cs (1)
49var endpoint = context.GetEndpoint() ?? throw new InvalidOperationException($"An endpoint must be set on the '{nameof(HttpContext)}'.");
Rendering\EndpointHtmlRenderer.cs (3)
123if (httpContext.GetEndpoint() is RouteEndpoint routeEndpoint) 133var endpoint = httpContext.GetEndpoint(); 154private static ResourceAssetCollection? GetResourceCollection(HttpContext httpContext) => httpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (1)
25var renderModesMetadata = httpContext.GetEndpoint()?.Metadata.GetMetadata<ConfiguredRenderModesMetadata>();
Rendering\SSRRenderModeBoundary.cs (1)
54var configuredRenderModesMetadata = httpContext.GetEndpoint()?.Metadata.GetMetadata<ConfiguredRenderModesMetadata>();
Microsoft.AspNetCore.Components.Server (1)
ComponentHub.cs (1)
126var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsMiddleware.cs (1)
98var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Diagnostics (9)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (3)
92Endpoint = httpContext.GetEndpoint(), 267endpoint: httpContext.GetEndpoint()?.ToString(), 338var endpoint = context.GetEndpoint();
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
160Endpoint = context.GetEndpoint(),
src\Shared\HttpExtensions.cs (2)
38var endpoint = context.GetEndpoint(); 51var endpoint = context.GetEndpoint();
StatusCodePage\StatusCodePagesExtensions.cs (1)
187Endpoint = context.HttpContext.GetEndpoint(),
StatusCodePage\StatusCodePagesMiddleware.cs (2)
43var endpoint = context.GetEndpoint(); 60if (shouldCheckEndpointAgain && HasSkipStatusCodePagesMetadata(context.GetEndpoint()))
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Logging\HttpLoggingRedactionInterceptor.cs (1)
89var endpoint = context.GetEndpoint() as RouteEndpoint;
Logging\HttpUtilityExtensions.cs (1)
40var endpoint = request.HttpContext.GetEndpoint();
Logging\IncomingHttpRouteUtility.cs (1)
42var endpoint = request.HttpContext.GetEndpoint();
Microsoft.AspNetCore.Diagnostics.Tests (2)
ExceptionHandlerMiddlewareTest.cs (1)
92Assert.Null(context.GetEndpoint());
StatusCodeMiddlewareTest.cs (1)
149Assert.Null(context.GetEndpoint());
Microsoft.AspNetCore.Hosting (2)
src\Shared\HttpExtensions.cs (2)
38var endpoint = context.GetEndpoint(); 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Http (3)
Builder\ApplicationBuilder.cs (1)
170var endpoint = context.GetEndpoint();
Internal\DefaultHttpRequest.cs (1)
18private static readonly Func<DefaultHttpRequest, IFormFeature> _newFormFeature = r => new FormFeature(r, r._context.FormOptions ?? FormOptions.Default, r._context.GetEndpoint());
Timeouts\RequestTimeoutsMiddleware.cs (1)
36var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Http.Abstractions (1)
HttpContext.cs (1)
93public Endpoint? Endpoint => _context.GetEndpoint();
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
EndpointHttpContextExtensionsTests.cs (7)
17var endpoint = context.GetEndpoint(); 34var endpoint = context.GetEndpoint(); 52var endpoint = context.GetEndpoint(); 84Assert.Equal(endpoint, context.GetEndpoint()); 106Assert.Equal(endpoint, context.GetEndpoint()); 127Assert.Null(context.GetEndpoint()); 139var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
760newHttpContext.SetEndpoint(context.GetEndpoint());
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ProblemDetailsServiceTest.cs (1)
158context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<SampleMetadata>();
Microsoft.AspNetCore.HttpLogging (1)
HttpLoggingMiddleware.cs (1)
58var loggingAttribute = context.GetEndpoint()?.Metadata.GetMetadata<HttpLoggingAttribute>();
Microsoft.AspNetCore.Mvc.Core (6)
Authorization\AuthorizeFilter.cs (2)
137var endpoint = context.HttpContext.GetEndpoint(); 224var endpoint = context.HttpContext.GetEndpoint();
Infrastructure\DefaultApiProblemDetailsWriter.cs (2)
38context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ControllerAttribute>(); 46context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<IApiBehaviorMetadata>();
Routing\ActionEndpointFactory.cs (1)
527var endpoint = context.GetEndpoint()!;
Routing\UrlHelperFactory.cs (1)
43var endpoint = httpContext.GetEndpoint();
Microsoft.AspNetCore.Mvc.Razor (1)
TagHelpers\UrlResolutionTagHelper.cs (1)
340return ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Microsoft.AspNetCore.Mvc.TagHelpers (2)
ResourceCollectionUtilities.cs (1)
15var assetCollection = viewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
ScriptTagHelper.cs (1)
247var importMap = ImportMap ?? ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>();
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
226var metadata = httpContext.GetEndpoint()?.Metadata;
Microsoft.AspNetCore.RateLimiting (2)
RateLimitingMiddleware.cs (2)
67var endpoint = context.GetEndpoint(); 258var enableRateLimitingAttribute = context.GetEndpoint()?.Metadata.GetMetadata<EnableRateLimitingAttribute>();
Microsoft.AspNetCore.RequestDecompression (1)
RequestDecompressionMiddleware.cs (1)
62context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>()?.MaxRequestBodySize
Microsoft.AspNetCore.Rewrite.Tests (1)
MiddlewareTests.cs (1)
660endpoints.MapGet("/foo", context => context.Response.WriteAsync($"{context.GetEndpoint()?.DisplayName} from {context.Request.Path}"));
Microsoft.AspNetCore.Routing (7)
EndpointMiddleware.cs (1)
35var endpoint = httpContext.GetEndpoint();
EndpointRoutingMiddleware.cs (3)
62var endpoint = httpContext.GetEndpoint(); 104var endpoint = httpContext.GetEndpoint(); 304var sizeLimitMetadata = context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>();
Matching\DfaMatcher.cs (1)
325if (httpContext.GetEndpoint() != null)
src\Shared\HttpExtensions.cs (2)
38var endpoint = context.GetEndpoint(); 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Routing.Microbenchmarks (10)
Matching\MatcherAzureBenchmark.cs (2)
42Validate(httpContext, Endpoints[sample], httpContext.GetEndpoint()); 54Validate(httpContext, Endpoints[sample], httpContext.GetEndpoint());
Matching\MatcherGithubBenchmark.cs (2)
34Validate(httpContext, Endpoints[i], httpContext.GetEndpoint()); 45Validate(httpContext, Endpoints[i], httpContext.GetEndpoint());
Matching\MatcherSingleEntryBenchmark.cs (4)
46Validate(httpContext, Endpoints[0], httpContext.GetEndpoint()); 55Validate(httpContext, Endpoints[0], httpContext.GetEndpoint()); 64Validate(httpContext, Endpoints[0], httpContext.GetEndpoint()); 73Validate(httpContext, Endpoints[0], httpContext.GetEndpoint());
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
101if (routeContext.HttpContext.GetEndpoint() != null)
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (1)
103if (routeContext.HttpContext.GetEndpoint() != null)
Microsoft.AspNetCore.Routing.Tests (60)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (1)
106Assert.Same(endpoint, httpContext.GetEndpoint());
Matching\AcceptsMatcherPolicyTest.cs (3)
536Assert.NotNull(httpContext.GetEndpoint()); 565Assert.Null(httpContext.GetEndpoint()); 595Assert.Null(httpContext.GetEndpoint());
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (7)
88Assert.Null(httpContext.GetEndpoint()); 108Assert.Null(httpContext.GetEndpoint()); 128Assert.Null(httpContext.GetEndpoint()); 148Assert.Null(httpContext.GetEndpoint()); 168Assert.Null(httpContext.GetEndpoint()); 207Assert.NotNull(httpContext.GetEndpoint()); 229Assert.Null(httpContext.GetEndpoint());
Matching\DefaultEndpointSelectorTest.cs (7)
26Assert.Null(httpContext.GetEndpoint()); 47Assert.Null(httpContext.GetEndpoint()); 68Assert.Same(endpoints[0], httpContext.GetEndpoint()); 89Assert.Same(endpoints[1], httpContext.GetEndpoint()); 111Assert.Same(endpoints[1], httpContext.GetEndpoint()); 142Assert.Same(endpoints[4], httpContext.GetEndpoint()); 167Assert.Null(httpContext.GetEndpoint());
Matching\DfaMatcherTest.cs (22)
79Assert.NotNull(httpContext.GetEndpoint()); 100Assert.Null(httpContext.GetEndpoint()); 129Assert.Null(httpContext.GetEndpoint()); 155Assert.Same(endpoint, httpContext.GetEndpoint()); 194Assert.Null(httpContext.GetEndpoint()); 220Assert.Same(endpoint, httpContext.GetEndpoint()); 269Assert.Same(endpoint, httpContext.GetEndpoint()); 304Assert.Same(endpoint1, httpContext.GetEndpoint()); 312Assert.Same(endpoint2, httpContext.GetEndpoint()); 338Assert.Same(endpoint, httpContext.GetEndpoint()); 598Assert.Same(endpoint, httpContext.GetEndpoint()); 636Assert.Equal(lowerOrderEndpoint, httpContext.GetEndpoint()); 682Assert.Equal(endpoint2, httpContext.GetEndpoint()); 728Assert.Equal(endpoint2, httpContext.GetEndpoint()); 775Assert.Equal(endpoint2, httpContext.GetEndpoint()); 797Assert.Null(httpContext.GetEndpoint()); 827Assert.Null(httpContext.GetEndpoint()); 867Assert.Null(httpContext.GetEndpoint()); 909Assert.Same(endpointDataSource.Endpoints[0], httpContext.GetEndpoint()); 978Assert.Same(dataSource.Endpoints[2], httpContext.GetEndpoint()); 1013Assert.Same(dataSource.Endpoints[1], httpContext.GetEndpoint()); 1062Assert.Same(dataSource.Endpoints[0], httpContext.GetEndpoint());
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (11)
78Assert.NotSame(endpoint, httpContext.GetEndpoint()); 79Assert.Same(HttpMethodMatcherPolicy.Http405EndpointDisplayName, httpContext.GetEndpoint().DisplayName); 196Assert.NotSame(endpoint1, httpContext.GetEndpoint()); 197Assert.NotSame(endpoint2, httpContext.GetEndpoint()); 199Assert.Same(HttpMethodMatcherPolicy.Http405EndpointDisplayName, httpContext.GetEndpoint().DisplayName); 202await httpContext.GetEndpoint().RequestDelegate(httpContext); 306Assert.NotSame(endpoint1, httpContext.GetEndpoint()); 307Assert.NotSame(endpoint2, httpContext.GetEndpoint()); 309Assert.Same(HttpMethodMatcherPolicy.Http405EndpointDisplayName, httpContext.GetEndpoint().DisplayName); 312await httpContext.GetEndpoint().RequestDelegate(httpContext); 317await httpContext.GetEndpoint().RequestDelegate(httpContext);
Matching\HttpMethodMatcherPolicyTest.cs (2)
172Assert.Equal(EndpointMetadataCollection.Empty, httpContext.GetEndpoint().Metadata); 173Assert.Equal(Http405EndpointDisplayName, httpContext.GetEndpoint().DisplayName, ignoreCase: true);
Matching\MatcherAssert.cs (5)
61if (httpContext.GetEndpoint() == null) 73if (!object.ReferenceEquals(expected, httpContext.GetEndpoint())) 77$"'{httpContext.GetEndpoint().DisplayName}' with values: {FormatRouteValues(actualValues)}."); 96if (httpContext.GetEndpoint() != null) 99$"Was expected not to match '{httpContext.GetEndpoint().DisplayName}' " +
Matching\RouteMatcherBuilder.cs (1)
101if (routeContext.HttpContext.GetEndpoint() != null)
Matching\TreeRouterMatcherBuilder.cs (1)
103if (routeContext.HttpContext.GetEndpoint() != null)
Microsoft.AspNetCore.SpaServices.Extensions (2)
SpaDefaultPageMiddleware.cs (2)
25if (context.GetEndpoint() != null) 46if (context.GetEndpoint() != null)
Microsoft.AspNetCore.StaticAssets (2)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
96var endpoint = _context.GetEndpoint()!;
StaticAssetsInvoker.cs (1)
163if (context.GetEndpoint() is Endpoint { Metadata: { } metadata } && metadata.GetMetadata<BuildAssetMetadata>() != null)
Microsoft.AspNetCore.StaticFiles (3)
DefaultFilesMiddleware.cs (1)
51if (context.GetEndpoint()?.RequestDelegate is null
DirectoryBrowserMiddleware.cs (1)
64if (context.GetEndpoint()?.RequestDelegate is null
StaticFileMiddleware.cs (1)
86private static bool ValidateNoEndpointDelegate(HttpContext context) => context.GetEndpoint()?.RequestDelegate is null;
Microsoft.AspNetCore.Tests (13)
WebApplicationTests.cs (13)
1694chosenEndpoint = c.GetEndpoint().DisplayName; 1721chosenEndpoint = c.GetEndpoint()?.DisplayName; 1722Assert.Null(c.GetEndpoint()); 1730chosenEndpoint = c.GetEndpoint().DisplayName; 1895chosenRoute = context.GetEndpoint()?.DisplayName; 1928chosenRoute = c.GetEndpoint()?.DisplayName; 1961chosenRoute = c.GetEndpoint()?.DisplayName; 1975chosenRoute = c.GetEndpoint()?.DisplayName; 1980chosenRoute = c.GetEndpoint()?.DisplayName; 2547chosenRoute = context.GetEndpoint()?.DisplayName; 2573chosenRoute = context.GetEndpoint()?.DisplayName; 2626chosenRoute = context.GetEndpoint()?.DisplayName; 2656chosenRoute = context.GetEndpoint()?.DisplayName;
MinimalSample (1)
Program.cs (1)
32var endpoint = invocationContext.HttpContext.GetEndpoint();
Mvc.RoutingWebSite (1)
Controllers\ConventionalControllerWithMetadata.cs (1)
14return Ok(HttpContext.GetEndpoint().Metadata.GetOrderedMetadata<MetadataAttribute>().Select(m => m.Value));
RoutingWebSite (1)
UseEndpointRoutingStartup.cs (1)
70var endpoint = httpContext.GetEndpoint();
StaticFilesAuth (1)
Startup.cs (1)
45if (context.Resource is HttpContext httpContext && httpContext.GetEndpoint() is Endpoint endpoint)