2 types derived from Endpoint
Microsoft.AspNetCore.Routing (1)
RouteEndpoint.cs (1)
12public sealed class RouteEndpoint : Endpoint
Microsoft.AspNetCore.Routing.Tests (1)
Builder\GroupTest.cs (1)
386private sealed class TestCustomEndpoint : Endpoint
155 instantiations of Endpoint
Microsoft.AspNetCore.Authorization.Test (2)
AuthorizationAppBuilderExtensionsTests.cs (1)
27var endpoint = new Endpoint(
AuthorizationMiddlewareTests.cs (1)
1003return new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(metadata), "Test endpoint");
Microsoft.AspNetCore.Components.Endpoints.Tests (10)
EndpointHtmlRendererTest.cs (8)
1185var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1206var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1236var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1264var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1318var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1356var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1386var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1451var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata),
SSRRenderModeBoundaryTest.cs (2)
20httpContext.SetEndpoint(new Endpoint(null, new EndpointMetadataCollection(), null)); 86httpContext.SetEndpoint(new Endpoint(null, new EndpointMetadataCollection(
Microsoft.AspNetCore.Cors.Test (12)
CorsEndpointConventionBuilderExtensionsTests.cs (1)
92return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
CorsMiddlewareTests.cs (11)
699httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint")); 729httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName")), "Test endpoint")); 756httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute(), new DisableCorsAttribute()), "Test endpoint")); 788httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute(), new DisableCorsAttribute()), "Test endpoint")); 821httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName")), "Test endpoint")); 856httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new CorsPolicyMetadata(metadataPolicy)), "Test endpoint")); 893httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute()), "Test endpoint")); 926httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new DisableCorsAttribute()), "Test endpoint")); 956httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint")); 983httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint")); 1008httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableCorsAttribute("MetadataPolicyName"), new DisableCorsAttribute()), "Test endpoint"));
Microsoft.AspNetCore.Diagnostics.Tests (5)
DeveloperExceptionPageMiddlewareTest.cs (1)
316var endpoint = new Endpoint(null, new EndpointMetadataCollection("my metadata"), null);
ExceptionHandlerMiddlewareTest.cs (2)
85httpContext.SetEndpoint(new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test")); 106var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test");
StatusCodeMiddlewareTest.cs (2)
157httpContext.SetEndpoint(new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test")); 199var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test");
Microsoft.AspNetCore.Http.Abstractions.Tests (6)
EndpointHttpContextExtensionsTests.cs (6)
45var initial = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 78var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 92var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 100var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 114var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 135var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint");
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
781context.SetEndpoint(new Endpoint(null, null, "TestName"));
Microsoft.AspNetCore.Http.Microbenchmarks (6)
RequestTimeoutsMiddlewareBenchmark.cs (6)
62var context = CreateHttpContext(new Endpoint(null, null, null)); 69var context = CreateHttpContext(new Endpoint(null, null, null)); 77var context = CreateHttpContext(new Endpoint( 88var context = CreateHttpContext(new Endpoint( 99var context = CreateHttpContext(new Endpoint( 110var context = CreateHttpContext(new Endpoint(null, null, null));
Microsoft.AspNetCore.Http.Tests (3)
ApplicationBuilderTests.cs (2)
57var endpoint = new Endpoint( 139var endpoint = new Endpoint(
Timeouts\RequestTimeoutsMiddlewareTests.cs (1)
343return new Endpoint(null, new EndpointMetadataCollection(metadata), "endpoint");
Microsoft.AspNetCore.HttpLogging.Tests (1)
HttpLoggingEndpointConventionBuilderTests.cs (1)
58return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
551return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
Microsoft.AspNetCore.Mvc.Core.Test (9)
Authorization\AuthorizeFilterTest.cs (1)
556ActionContext.HttpContext.SetEndpoint(new Endpoint(
Infrastructure\ActionSelectionTableTest.cs (1)
557return new Endpoint(
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
210context.SetEndpoint(new Endpoint(null, metadata, string.Empty));
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (5)
48new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[0]), "Test1"), 49new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[1]), "Test2"), 50new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[2]), "Test3"), 53DynamicEndpoint = new Endpoint( 356new Endpoint((ctx) => Task.CompletedTask, new EndpointMetadataCollection(Array.Empty<object>()), "ReplacedEndpoint")
Routing\EndpointRoutingUrlHelperTest.cs (1)
141httpContext.SetEndpoint(new Endpoint(context => Task.CompletedTask, EndpointMetadataCollection.Empty, null));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
PageLoaderMatcherPolicyTest.cs (1)
90return new Endpoint(
Microsoft.AspNetCore.Mvc.RazorPages.Test (7)
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (7)
40new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[0]), "Test1"), 41new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(actions[1]), "Test2"), 44DynamicEndpoint = new Endpoint( 72new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test1"), 73new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test2"), 74new Endpoint(_ => Task.CompletedTask, EndpointMetadataCollection.Empty, "ReplacedLoaded") 358new Endpoint((ctx) => Task.CompletedTask, new EndpointMetadataCollection(new PageActionDescriptor()
Microsoft.AspNetCore.Mvc.Test (1)
Routing\ActionConstraintMatcherPolicyTest.cs (1)
479return new Endpoint(
Microsoft.AspNetCore.RateLimiting.Tests (5)
RateLimitingMiddlewareTests.cs (4)
497var endpoint1 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName1)), "Test endpoint 1"); 498var endpoint2 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName2)), "Test endpoint 2"); 537context.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(name), new DisableRateLimitingAttribute()), "Test endpoint")); 545context.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new DisableRateLimitingAttribute(), new EnableRateLimitingAttribute(name)), "Test endpoint"));
TestEndpointBuilder.cs (1)
18return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
81Endpoint = new Endpoint(
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionMiddlewareTests.cs (1)
758Endpoint = new Endpoint(
Microsoft.AspNetCore.Routing (3)
Matching\AcceptsMatcherPolicy.cs (1)
251return Http415Endpoint ??= new Endpoint(context =>
Matching\HttpMethodMatcherPolicy.cs (1)
383return new Endpoint(
Matching\NegotiationMatcherPolicy.cs (1)
311Http406Endpoint ??= new Endpoint(
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
EndpointRoutingShortCircuitBenchmark.cs (2)
27var normalEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(), "normal"); 39var shortCircuitEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(new ShortCircuitMetadata(200)), "shortcircuit");
Microsoft.AspNetCore.Routing.Tests (69)
DefaultEndpointDataSourceTests.cs (8)
15new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"), 16new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2") 29var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"); 30var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2"); 59new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"), 60new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2") 73var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"); 74var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2");
EndpointMiddlewareTest.cs (11)
79httpContext.SetEndpoint(new Endpoint(endpointFunc, EndpointMetadataCollection.Empty, "Test")); 113httpContext.SetEndpoint(new Endpoint(throwIfCalled, new EndpointMetadataCollection(Mock.Of<IAuthorizeData>()), "Test")); 142httpContext.SetEndpoint(new Endpoint(requestDelegate: null, new EndpointMetadataCollection(Mock.Of<IAuthorizeData>()), "Test")); 169httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(Mock.Of<IAuthorizeData>()), "Test")); 203httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(Mock.Of<IAuthorizeData>()), "Test")); 239httpContext.SetEndpoint(new Endpoint(throwIfCalled, new EndpointMetadataCollection(Mock.Of<ICorsMetadata>()), "Test")); 266httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(Mock.Of<ICorsMetadata>()), "Test")); 300httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(Mock.Of<IAuthorizeData>()), "Test")); 337httpContext.SetEndpoint(new Endpoint(throwIfCalled, new EndpointMetadataCollection(AntiforgeryMetadata.ValidationRequired), "Test")); 364httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(AntiforgeryMetadata.ValidationRequired), "Test")); 398httpContext.SetEndpoint(new Endpoint(endpointFunc, new EndpointMetadataCollection(AntiforgeryMetadata.ValidationRequired), "Test"));
EndpointRoutingMiddlewareFormOptionsTest.cs (7)
39c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 73c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata1, formOptionsMetadata2, formOptionsMetadata3), "myapp")); 111c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 139var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp"); 146c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp")); 171var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp"); 178c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(formOptionsMetadata), "myapp"));
EndpointRoutingMiddlewareTest.cs (6)
45httpContext.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(), "myapp")); 250c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 286c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 315c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp")); 343c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(), "myapp")); 374c.SetEndpoint(new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(metadata), "myapp"));
Internal\DfaGraphWriterTest.cs (1)
27var endpointsDataSource = new DefaultEndpointDataSource(new Endpoint((context) => null, EndpointMetadataCollection.Empty, string.Empty));
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (19)
25new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 42new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 43new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 61new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(new DynamicMetadata()), "Endpoint -> Dynamic Endpoint Metadata"), 78new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 98new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 117new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 218new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 295new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 314new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 333new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 386new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 446new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 465new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding")); 482new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Endpoint -> No Content Encoding"), 572new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 590new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 608new Endpoint(_ => Task.CompletedTask, new EndpointMetadataCollection(), "Identity"), 636var endpoint = new Endpoint(
Matching\DataSourceDependentMatcherTest.cs (1)
85var endpoint = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "test");
Matching\DfaMatcherBuilderTest.cs (1)
3676var maxValueEndpoint = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "MaxValueEndpoint");
Matching\EndpointMetadataComparerTest.cs (10)
14var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 15var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2"); 28var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test1"); 29var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test2"); 42var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 43var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test2"); 56var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test1"); 57var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2"); 70var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 71var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2");
RouteOptionsTests.cs (2)
37var endpoint1 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty); 38var endpoint2 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty);
RoutingMetricsTests.cs (1)
93c.SetEndpoint(new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test name"));
TestObjects\TestMatcher.cs (1)
21c.SetEndpoint(new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "Test endpoint"));
TestObjects\TestMatcherFactory.cs (1)
79httpContext.SetEndpoint(new Endpoint(TestConstants.ShortCircuitRequestDelegate, metadata, "Short Circuit Endpoint"));
Microsoft.AspNetCore.Security.Microbenchmarks (1)
AuthorizationMiddlewareBenchmark.cs (1)
28Endpoint = new Endpoint((context) => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint")
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
StaticFileMiddlewareTests.cs (1)
63context.SetEndpoint(new Endpoint((c) =>
Microsoft.AspNetCore.StaticFiles.Tests (6)
DefaultFilesMiddlewareTests.cs (2)
93context.SetEndpoint(new Endpoint((c) => 136context.SetEndpoint(new Endpoint(requestDelegate: null,
DirectoryBrowserMiddlewareTests.cs (2)
110context.SetEndpoint(new Endpoint((c) => 151context.SetEndpoint(new Endpoint(requestDelegate: null,
StaticFileMiddlewareTests.cs (2)
347ctx.SetEndpoint(new Endpoint(requestDelegate: null, new EndpointMetadataCollection(), "NullRequestDelegateEndpoint")); 395ctx.SetEndpoint(new Endpoint(handler, new EndpointMetadataCollection(), "RequestDelegateEndpoint"));
StaticFilesAuth (1)
Startup.cs (1)
132var endpoint = new Endpoint(
1070 references to Endpoint
IntegrationTestsWebsite (5)
Infrastructure\DynamicEndpointDataSource.cs (5)
14private readonly List<Endpoint> _endpoints = new List<Endpoint>(); 18public override IReadOnlyList<Endpoint> Endpoints => _endpoints; 34public void AddEndpoints(IEnumerable<Endpoint> endpoints) 37foreach (var newEndpoint in endpoints)
Microsoft.AspNetCore (1)
WebApplication.cs (1)
271public IReadOnlyList<Endpoint> Endpoints
Microsoft.AspNetCore.Antiforgery (5)
AntiforgeryMiddleware.cs (1)
18var endpoint = context.GetEndpoint();
src\Shared\HttpExtensions.cs (4)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 38var endpoint = context.GetEndpoint(); 42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint) 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Authorization.Policy (8)
AuthorizationMiddleware.cs (1)
97var endpoint = context.GetEndpoint();
AuthorizationPolicyCache.cs (5)
13private readonly DataSourceDependentCache<ConcurrentDictionary<Endpoint, AuthorizationPolicy>> _policyCache; 19_policyCache = new DataSourceDependentCache<ConcurrentDictionary<Endpoint, AuthorizationPolicy>>(dataSource, (_) => 22return new ConcurrentDictionary<Endpoint, AuthorizationPolicy>(); 27public AuthorizationPolicy? Lookup(Endpoint endpoint) 33public void Store(Endpoint endpoint, AuthorizationPolicy policy)
src\Http\Routing\src\DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
Microsoft.AspNetCore.Authorization.Test (10)
AuthorizationAppBuilderExtensionsTests.cs (1)
27var endpoint = new Endpoint(
AuthorizationMiddlewareTests.cs (9)
224private static EndpointDataSource CreateDataSource(Endpoint endpoint) 227dataSource.Setup(d => d.Endpoints).Returns(new Endpoint[] { endpoint }); 250var endpoint = CreateEndpoint(new AuthorizeAttribute("whatever"), new ReqAttribute(req)); 290var endpoint = CreateEndpoint(new AuthorizeAttribute("whatever"), new ReqAttribute(req)); 359var endpoint = CreateEndpoint(new AuthorizeAttribute("whatever")); 662var endpoint = CreateEndpoint(new AuthorizeAttribute()); 691var endpoint = CreateEndpoint(new AuthorizeAttribute()); 1001private Endpoint CreateEndpoint(params object[] metadata) 1009Endpoint endpoint = null,
Microsoft.AspNetCore.Components.Endpoints (6)
Builder\RazorComponentEndpointDataSource.cs (3)
28private List<Endpoint>? _endpoints; 66public override IReadOnlyList<Endpoint> Endpoints 104var endpoints = new List<Endpoint>();
Builder\RazorComponentEndpointFactory.cs (1)
23List<Endpoint> endpoints,
Builder\RenderModeEndpointProvider.cs (1)
35List<Endpoint> endpoints,
RazorComponentEndpointInvoker.cs (1)
47var endpoint = context.GetEndpoint() ?? throw new InvalidOperationException($"An endpoint must be set on the '{nameof(HttpContext)}'.");
Microsoft.AspNetCore.Components.Endpoints.Tests (18)
EndpointHtmlRendererTest.cs (8)
1185var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1206var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1236var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1264var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1318var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1356var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1386var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata), 1451var endpoint = new Endpoint((context) => Task.CompletedTask, new EndpointMetadataCollection(declaredRenderModesMetadata),
RazorComponentEndpointFactoryTest.cs (10)
17var endpoints = new List<Endpoint>(); 32var endpoint = Assert.Single(endpoints); 55var endpoints = new List<Endpoint>(); 74var endpoint = Assert.Single(endpoints); 81var endpoints = new List<Endpoint>(); 102var endpoint = Assert.Single(endpoints); 109var endpoints = new List<Endpoint>(); 130var endpoint = Assert.Single(endpoints); 138var endpoints = new List<Endpoint>(); 162var endpoint = Assert.Single(endpoints);
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
145foreach (var endpoint in ds.Endpoints)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
WebAssemblyRazorComponentsBuilderExtensions.cs (1)
115foreach (var endpoint in ds.Endpoints)
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsMiddleware.cs (1)
98var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Cors.Test (4)
CorsEndpointConventionBuilderExtensionsTests.cs (4)
25var endpoint = endpointModel.Build(); 46var endpoint = endpointBuilder.Build(); 68var endpoint = endpointModel.Build(); 90public override Endpoint Build()
Microsoft.AspNetCore.Diagnostics (9)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
318var endpoint = context.GetEndpoint();
ExceptionHandler\ExceptionHandlerFeature.cs (1)
21public Endpoint? Endpoint { get; set; }
src\Shared\HttpExtensions.cs (4)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 38var endpoint = context.GetEndpoint(); 42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint) 51var endpoint = context.GetEndpoint();
StatusCodePage\StatusCodePagesMiddleware.cs (2)
43var endpoint = context.GetEndpoint(); 80private static bool HasSkipStatusCodePagesMetadata(Endpoint? endpoint)
StatusCodePage\StatusCodeReExecuteFeature.cs (1)
25public Endpoint? Endpoint { get; set; }
Microsoft.AspNetCore.Diagnostics.Abstractions (4)
IExceptionHandlerFeature.cs (2)
26/// Gets the selected <see cref="Http.Endpoint"/> for the original request. 28Endpoint? Endpoint => null;
IStatusCodeReExecuteFeature.cs (2)
37/// Gets the selected <see cref="Http.Endpoint"/> for the original request. 39Endpoint? Endpoint => null;
Microsoft.AspNetCore.Diagnostics.Tests (6)
DeveloperExceptionPageMiddlewareTest.cs (1)
316var endpoint = new Endpoint(null, new EndpointMetadataCollection("my metadata"), null);
ExceptionHandlerMiddlewareTest.cs (4)
106var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test"); 302var originalEndpoint = originalEndpointBuilder.Build(); 362var originalEndpoint = originalEndpointBuilder.Build(); 365var newEndpoint = newEndpointBuilder.Build();
StatusCodeMiddlewareTest.cs (1)
199var endpoint = new Endpoint((_) => Task.CompletedTask, new EndpointMetadataCollection(), "Test");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
JsonTranscodingServiceMethodProviderTests.cs (3)
223private static RouteEndpoint FindGrpcEndpoint(IReadOnlyList<Endpoint> endpoints, string methodName) 234private static List<RouteEndpoint> FindGrpcEndpoints(IReadOnlyList<Endpoint> endpoints, string methodName) 261private IReadOnlyList<Endpoint> MapEndpoints<TService>(Action<ILoggingBuilder>? configureLogging = null)
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
39foreach (var endpoint in endpoints)
Microsoft.AspNetCore.Hosting (5)
Internal\HostingApplicationDiagnostics.cs (1)
157var endpoint = HttpExtensions.GetOriginalEndpoint(httpContext);
src\Shared\HttpExtensions.cs (4)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 38var endpoint = context.GetEndpoint(); 42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint) 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Http (5)
Builder\ApplicationBuilder.cs (1)
170var endpoint = context.GetEndpoint();
Features\FormFeature.cs (3)
20private readonly Endpoint? _endpoint; 58internal FormFeature(HttpRequest request, FormOptions options, Endpoint? endpoint) 392private static FormOptions GetFormOptionsFromMetadata(FormOptions baseFormOptions, Endpoint endpoint)
Timeouts\RequestTimeoutsMiddleware.cs (1)
36var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Http.Abstractions (28)
Extensions\EndpointBuilder.cs (4)
9/// A base class for building an new <see cref="Endpoint"/>. 41/// Creates an instance of <see cref="Endpoint"/> from the <see cref="EndpointBuilder"/>. 43/// <returns>The created <see cref="Endpoint"/>.</returns> 44public abstract Endpoint Build();
HttpContext.cs (1)
93public Endpoint? Endpoint => _context.GetEndpoint();
HttpResults\INestedHttpResult.cs (1)
14/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate.
Metadata\IEndpointDescriptionMetadata.cs (1)
7/// Defines a contract used to specify a description in <see cref="Endpoint.Metadata"/>.
Metadata\IEndpointMetadataProvider.cs (4)
10/// Indicates that a type provides a static method that provides <see cref="Endpoint"/> metadata when declared as a parameter type or the 11/// returned type of an <see cref="Endpoint"/> route handler delegate. 16/// Populates metadata for the related <see cref="Endpoint"/> and <see cref="MethodInfo"/>. 21/// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built.
Metadata\IEndpointParameterMetadataProvider.cs (4)
10/// Indicates that a type provides a static method that provides <see cref="Endpoint"/> metadata when declared as the 11/// parameter type of an <see cref="Endpoint"/> route handler delegate. 16/// Populates metadata for the related <see cref="Endpoint"/> and <see cref="ParameterInfo"/>. 21/// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built.
Metadata\IStatusCodePagesMetadata.cs (1)
8/// middleware in <see cref="Endpoint.Metadata"/>.
Metadata\ISummaryMetadata.cs (1)
7/// Defines a contract used to specify a summary in <see cref="Endpoint.Metadata"/>.
Metadata\ITagsMetadata.cs (1)
7/// Defines a contract used to specify a collection of tags in <see cref="Endpoint.Metadata"/>.
Routing\Endpoint.cs (1)
15/// Creates a new instance of <see cref="Endpoint"/>.
Routing\EndpointHttpContextExtensions.cs (7)
14/// Extension method for getting the <see cref="Endpoint"/> for the current request. 17/// <returns>The <see cref="Endpoint"/>.</returns> 18public static Endpoint? GetEndpoint(this HttpContext context) 26/// Extension method for setting the <see cref="Endpoint"/> for the current request. 29/// <param name="endpoint">The <see cref="Endpoint"/>.</param> 30public static void SetEndpoint(this HttpContext context, Endpoint? endpoint) 60public Endpoint? Endpoint { get; set; }
Routing\IEndpointFeature.cs (2)
13/// Gets or sets the selected <see cref="Http.Endpoint"/> for the current 16Endpoint? Endpoint { get; set; }
Microsoft.AspNetCore.Http.Abstractions.Tests (11)
EndpointHttpContextExtensionsTests.cs (11)
17var endpoint = context.GetEndpoint(); 34var endpoint = context.GetEndpoint(); 45var initial = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 52var endpoint = context.GetEndpoint(); 78var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 92var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 100var endpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 114var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 135var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint"); 139var endpoint = context.GetEndpoint(); 147public Endpoint? Endpoint { get; set; }
Microsoft.AspNetCore.Http.Extensions (4)
EndpointDescriptionAttribute.cs (1)
10/// Specifies a description for the endpoint in <see cref="Endpoint.Metadata"/>.
EndpointSummaryAttribute.cs (1)
11/// Specifies a summary in <see cref="Endpoint.Metadata"/>.
RequestDelegateFactory.cs (1)
2856public override Endpoint Build()
TagsAttribute.cs (1)
11/// Specifies a collection of tags in <see cref="Endpoint.Metadata"/>.
Microsoft.AspNetCore.Http.Extensions.Tests (242)
RequestDelegateGenerator\CompileTimeCreationTests.cs (14)
28var endpoint = GetEndpointFromCompilation(compilation, false); 40var endpoint = GetEndpointFromCompilation(compilation); 179var endpoint = GetEndpointFromCompilation(updatedCompilation); 355foreach (var endpoint in endpoints) 379foreach (var endpoint in endpoints) 405foreach (var endpoint in endpoints) 453var endpoint = GetEndpointFromCompilation(compilation); 470var endpoint = GetEndpointFromCompilation(compilation); 502var endpoint1 = endpoints[0]; 509var endpoint2 = endpoints[1]; 548var endpoint1 = endpoints[0]; 553var endpoint2 = endpoints[1]; 583var endpoint = GetEndpointFromCompilation(compilation); 602var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\CompileTimeCreationTests.Routes.cs (3)
18var endpoint = GetEndpointFromCompilation(compilation); 41var endpoint = GetEndpointFromCompilation(compilation); 76var endpoint = endpoints[i];
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
114internal Endpoint GetEndpointFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null) => 117internal Endpoint[] GetEndpointsFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null, bool skipGeneratedCodeCheck = false) 177foreach (var endpoint in endpoints)
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (19)
27var endpoint = GetEndpointFromCompilation(compilation); 48var endpoint = GetEndpointFromCompilation(compilation); 69var endpoint = GetEndpointFromCompilation(compilation); 90var endpoint = GetEndpointFromCompilation(compilation); 163var endpoint = GetEndpointFromCompilation(compilation); 188var endpoint = GetEndpointFromCompilation(compilation); 209var endpoint = GetEndpointFromCompilation(compilation); 230var endpoint = GetEndpointFromCompilation(compilation); 251var endpoint = GetEndpointFromCompilation(compilation); 271var endpoint = GetEndpointFromCompilation(compilation); 292var endpoint = GetEndpointFromCompilation(compilation); 313var endpoint = GetEndpointFromCompilation(compilation); 334var endpoint = GetEndpointFromCompilation(compilation); 355var endpoint = GetEndpointFromCompilation(compilation); 382var endpoint = GetEndpointFromCompilation(compilation); 409var endpoint = GetEndpointFromCompilation(compilation); 436var endpoint = GetEndpointFromCompilation(compilation); 463var endpoint = GetEndpointFromCompilation(compilation); 498var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (10)
25var endpoint = GetEndpointFromCompilation(compilation); 58var endpoint = GetEndpointFromCompilation(compilation); 93var endpoint = GetEndpointFromCompilation(compilation); 197var endpoint = GetEndpointFromCompilation(compilation); 221var endpoint = GetEndpointFromCompilation(compilation); 276var endpoint = GetEndpointFromCompilation(compilation); 310var endpoint = GetEndpointFromCompilation(compilation); 337var endpoint = GetEndpointFromCompilation(compilation); 363var endpoint = GetEndpointFromCompilation(compilation); 378var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (8)
54var endpoint = GetEndpointFromCompilation(compilation); 75var endpoint = GetEndpointFromCompilation(compilation); 96var endpoint = GetEndpointFromCompilation(compilation); 126var endpoint = GetEndpointFromCompilation(compilation); 192var endpoint = GetEndpointFromCompilation(compilation); 244var endpoint = GetEndpointFromCompilation(compilation); 300var endpoint = GetEndpointFromCompilation(compilation); 324foreach (var endpoint in endpoints)
RequestDelegateGenerator\RequestDelegateCreationTests.cs (14)
32var endpoint = GetEndpointFromCompilation(compilation); 53var endpoint = GetEndpointFromCompilation(compilation); 88var endpoint = GetEndpointFromCompilation(compilation); 208var endpoint = GetEndpointFromCompilation(compilation); 265var endpoint = GetEndpointFromCompilation(compilation); 392var endpoint = GetEndpointFromCompilation(compilation); 410var endpoint = GetEndpointFromCompilation(compilation); 428var endpoint = GetEndpointFromCompilation(compilation); 454var endpoint = GetEndpointFromCompilation(compilation); 480var endpoint = GetEndpointFromCompilation(compilation); 501var endpoint = GetEndpointFromCompilation(compilation); 526var endpoint = GetEndpointFromCompilation(compilation); 551var endpoint = GetEndpointFromCompilation(compilation); 581var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.Filters.cs (15)
31var endpoint = GetEndpointFromCompilation(compilation); 59var endpoint = GetEndpointFromCompilation(compilation); 96var endpoint = GetEndpointFromCompilation(compilation); 138var endpoint = GetEndpointFromCompilation(compilation); 180var endpoint = GetEndpointFromCompilation(compilation); 222var endpoint = GetEndpointFromCompilation(compilation); 266var endpoint = GetEndpointFromCompilation(compilation); 296var endpoint = GetEndpointFromCompilation(compilation); 337var endpoint = GetEndpointFromCompilation(compilation); 400var endpoint = GetEndpointFromCompilation(compilation); 457var endpoint = GetEndpointFromCompilation(compilation); 523var endpoint = GetEndpointFromCompilation(compilation); 547var endpoint = GetEndpointFromCompilation(compilation); 614var endpoint = GetEndpointFromCompilation(compilation); 629public Endpoint Endpoint { get; set; }
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (26)
23var endpoint = GetEndpointFromCompilation(compilation); 58var endpoint = GetEndpointFromCompilation(compilation); 93var endpoint = GetEndpointFromCompilation(compilation); 131var endpoint = GetEndpointFromCompilation(compilation); 167var endpoint = GetEndpointFromCompilation(compilation); 210var endpoint = GetEndpointFromCompilation(compilation); 247var endpoint = GetEndpointFromCompilation(compilation); 283var endpoint = GetEndpointFromCompilation(compilation); 319var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: CreateServiceProvider()); 356var endpoint = GetEndpointFromCompilation(compilation); 390var endpoint = GetEndpointFromCompilation(compilation); 439var endpoint = GetEndpointFromCompilation(compilation); 479var endpoint = GetEndpointFromCompilation(compilation); 542var endpoint = GetEndpointFromCompilation(compilation); 589var endpoint = GetEndpointFromCompilation(compilation); 636var endpoint = GetEndpointFromCompilation(compilation); 665var endpoint = GetEndpointFromCompilation(compilation); 698var endpoint = GetEndpointFromCompilation(compilation); 728var endpoint = GetEndpointFromCompilation(compilation); 758var endpoint = GetEndpointFromCompilation(compilation); 816var endpoint = GetEndpointFromCompilation(compilation); 864var endpoint = GetEndpointFromCompilation(compilation); 893var endpoint = GetEndpointFromCompilation(compilation); 925var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 959var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 996var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (9)
82var endpoint = GetEndpointFromCompilation(compilation); 102var endpoint = GetEndpointFromCompilation(compilation); 224var endpoint = GetEndpointFromCompilation(compilation); 264var endpoint = GetEndpointFromCompilation(compilation); 305var endpoint = GetEndpointFromCompilation(compilation); 346var endpoint = GetEndpointFromCompilation(compilation); 395var endpoint = GetEndpointFromCompilation(compilation); 423var endpoint = GetEndpointFromCompilation(compilation); 463var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (5)
51var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 79var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 120var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 195var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 219var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider);
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (8)
21var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 87var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 107var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 122var endpoint = GetEndpointFromCompilation(compilation); 138var endpoint = GetEndpointFromCompilation(compilation); 164var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 193var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 220var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider);
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
33var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 95var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 146var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 183var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 217var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 264var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 297var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 344var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 381var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 427var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 476var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 513var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 554var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 594var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 634var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider);
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (33)
31var endpoint = GetEndpointFromCompilation(compilation); 47var endpoint = GetEndpointFromCompilation(compilation); 63var endpoint = GetEndpointFromCompilation(compilation); 77var endpoint = GetEndpointFromCompilation(compilation); 91var endpoint = GetEndpointFromCompilation(compilation); 103var endpoint = GetEndpointFromCompilation(compilation); 117var endpoint = GetEndpointFromCompilation(compilation); 130var endpoint = GetEndpointFromCompilation(compilation); 146var endpoint = GetEndpointFromCompilation(compilation); 161var endpoint = GetEndpointFromCompilation(compilation); 173var endpoint = GetEndpointFromCompilation(compilation); 187var endpoint = GetEndpointFromCompilation(compilation); 204var endpoint = GetEndpointFromCompilation(compilation); 220var endpoint = GetEndpointFromCompilation(compilation); 235var endpoint = GetEndpointFromCompilation(compilation); 250var endpoint = GetEndpointFromCompilation(compilation); 265var endpoint = GetEndpointFromCompilation(compilation); 281var endpoint = GetEndpointFromCompilation(compilation); 296var endpoint = GetEndpointFromCompilation(compilation); 311var endpoint = GetEndpointFromCompilation(compilation); 326var endpoint = GetEndpointFromCompilation(compilation); 341var endpoint = GetEndpointFromCompilation(compilation); 361var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 381var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 395var endpoint = GetEndpointFromCompilation(compilation); 412var endpoint = GetEndpointFromCompilation(compilation); 429var endpoint = GetEndpointFromCompilation(compilation); 446var endpoint = GetEndpointFromCompilation(compilation); 462var endpoint = GetEndpointFromCompilation(compilation); 478var endpoint = GetEndpointFromCompilation(compilation); 494var endpoint = GetEndpointFromCompilation(compilation); 509var endpoint = GetEndpointFromCompilation(compilation); 551var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (5)
46var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 89var endpoint = GetEndpointFromCompilation(compilation); 113var endpoint = GetEndpointFromCompilation(compilation); 134var endpoint = GetEndpointFromCompilation(compilation); 167var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (22)
29var endpoint = GetEndpointFromCompilation(compilation); 53var endpoint = GetEndpointFromCompilation(compilation); 76var endpoint = GetEndpointFromCompilation(compilation); 110var endpoint = GetEndpointFromCompilation(compilation); 134var endpoint = GetEndpointFromCompilation(compilation); 161var endpoint = GetEndpointFromCompilation(compilation); 186var endpoint = GetEndpointFromCompilation(compilation); 214var endpoint = GetEndpointFromCompilation(compilation); 309var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 354var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 385var endpoint = GetEndpointFromCompilation(compilation, serviceProvider: serviceProvider); 404var endpoint = GetEndpointFromCompilation(compilation); 461var endpoint = GetEndpointFromCompilation(compilation); 482var endpoint = GetEndpointFromCompilation(compilation); 563var endpoint = GetEndpointFromCompilation(compilation); 643var endpoint = GetEndpointFromCompilation(compilation); 666var endpoint = GetEndpointFromCompilation(compilation); 754var endpoint = GetEndpointFromCompilation(compilation); 773var endpoint = GetEndpointFromCompilation(compilation); 831var endpoint = GetEndpointFromCompilation(compilation); 887var endpoint = GetEndpointFromCompilation(compilation); 971foreach (var endpoint in endpoints)
RequestDelegateGenerator\RequestDelegateCreationTests.RouteParameter.cs (7)
48var endpoint = GetEndpointFromCompilation(compilation); 108var endpoint = GetEndpointFromCompilation(compilation); 132var endpoint = GetEndpointFromCompilation(compilation); 149var endpoint = GetEndpointFromCompilation(compilation); 183var endpoint = GetEndpointFromCompilation(compilation); 196var endpoint = GetEndpointFromCompilation(compilation); 223var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.SpecialTypes.cs (8)
34var endpoint = GetEndpointFromCompilation(compilation); 53var endpoint = GetEndpointFromCompilation(compilation); 76var endpoint = GetEndpointFromCompilation(compilation); 97var endpoint = GetEndpointFromCompilation(compilation); 116var endpoint = GetEndpointFromCompilation(compilation); 140var endpoint = GetEndpointFromCompilation(compilation); 244var endpoint = GetEndpointFromCompilation(compilation); 276var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (9)
73var endpoint = GetEndpointFromCompilation(compilation); 113var endpoint = GetEndpointFromCompilation(compilation); 145var endpoint = GetEndpointFromCompilation(compilation); 162var endpoint = GetEndpointFromCompilation(compilation); 185var endpoint = GetEndpointFromCompilation(compilation); 209var endpoint = GetEndpointFromCompilation(compilation); 226var endpoint = GetEndpointFromCompilation(compilation); 254var endpoint = GetEndpointFromCompilation(compilation); 274var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (7)
21var endpoint = GetEndpointFromCompilation(compilation); 53var endpoint = GetEndpointFromCompilation(compilation); 89var endpoint = GetEndpointFromCompilation(compilation); 122var endpoint = GetEndpointFromCompilation(compilation); 159var endpoint = GetEndpointFromCompilation(compilation); 198var endpoint = GetEndpointFromCompilation(compilation); 231var endpoint = GetEndpointFromCompilation(compilation);
RequestDelegateGenerator\RuntimeCreationTests.cs (2)
37var endpoint = GetEndpointFromCompilation(compilation); 51var endpoint = GetEndpointFromCompilation(compilation);
Microsoft.AspNetCore.Http.Microbenchmarks (4)
RequestTimeoutsMiddlewareBenchmark.cs (1)
115private HttpContext CreateHttpContext(Endpoint endpoint)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
114internal Endpoint GetEndpointFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null) => 117internal Endpoint[] GetEndpointsFromCompilation(Compilation compilation, bool? expectGeneratedCodeOverride = null, IServiceProvider serviceProvider = null, bool skipGeneratedCodeCheck = false) 177foreach (var endpoint in endpoints)
Microsoft.AspNetCore.Http.Results (5)
ResultsOfT.Generated.cs (5)
35/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 99/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 172/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 254/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate. 345/// Gets the actual <see cref="IResult"/> returned by the <see cref="Endpoint"/> route handler delegate.
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsOfTHelperTests.cs (1)
93public override Endpoint Build()
Microsoft.AspNetCore.Http.Tests (13)
ApplicationBuilderTests.cs (2)
57var endpoint = new Endpoint( 139var endpoint = new Endpoint(
Timeouts\RequestTimeoutsMiddlewareTests.cs (11)
33var endpoint = CreateEndpoint(); 49var endpoint = CreateEndpoint(new RequestTimeoutPolicy { Timeout = TimeSpan.FromSeconds(47) }); 64var endpoint = CreateEndpoint(new RequestTimeoutAttribute("policy2")); 79var endpoint = CreateEndpoint(new RequestTimeoutAttribute(3000)); 112var endpoint = CreateEndpoint(new RequestTimeoutAttribute("policy1")); 128var endpoint = CreateEndpoint(new RequestTimeoutAttribute(3000)); 144var endpoint = CreateEndpoint(new RequestTimeoutPolicy { Timeout = TimeSpan.FromSeconds(47) }, new RequestTimeoutAttribute("policy1")); 163var endpoint = CreateEndpoint(new DisableRequestTimeoutAttribute(), 180var endpoint = CreateEndpoint(new RequestTimeoutAttribute("policy47")); 228var endpoint = CreateEndpoint(new RequestTimeoutAttribute("policy1")); 341private static Endpoint CreateEndpoint(params object[] metadata)
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingEndpointConventionBuilderTests.cs (2)
28var endpoint = endpointModel.Build(); 56public override Endpoint Build()
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
DependencyInjection\EndpointMethodInfoApiExplorerServiceCollectionExtensions.cs (2)
12/// Extensions for configuring ApiExplorer using <see cref="Endpoint.Metadata"/>. 17/// Configures ApiExplorer using <see cref="Endpoint.Metadata"/>.
EndpointMetadataApiDescriptionProvider.cs (1)
60foreach (var endpoint in _endpointDataSource.Endpoints)
Microsoft.AspNetCore.Mvc.Core (41)
Authorization\AuthorizeFilter.cs (2)
137var endpoint = context.HttpContext.GetEndpoint(); 224var endpoint = context.HttpContext.GetEndpoint();
Infrastructure\ActionSelectionTable.cs (4)
78public static ActionSelectionTable<Endpoint> Create(IEnumerable<Endpoint> endpoints) 80return CreateCore<Endpoint>( 88return e.GetType() == typeof(Endpoint);
Routing\ActionConstraintMatcherPolicy.cs (3)
31public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 40var endpoint = endpoints[i]; 136var endpoint = candidate.Endpoint;
Routing\ActionEndpointDataSourceBase.cs (4)
28private List<Endpoint>? _endpoints; 41public override IReadOnlyList<Endpoint> Endpoints 52public override IReadOnlyList<Endpoint> GetGroupedEndpoints(RouteGroupContext context) 64protected abstract List<Endpoint> CreateEndpoints(
Routing\ActionEndpointFactory.cs (4)
39List<Endpoint> endpoints, 175List<Endpoint> endpoints, 527var endpoint = context.GetEndpoint()!; 549public override Endpoint Build()
Routing\ControllerActionEndpointDataSource.cs (2)
65protected override List<Endpoint> CreateEndpoints( 73var endpoints = new List<Endpoint>();
Routing\DynamicControllerEndpointMatcherPolicy.cs (3)
30public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 76var endpoint = candidates[i].Endpoint; 162private DynamicControllerEndpointSelector ResolveSelector(DynamicControllerEndpointSelector? currentSelector, Endpoint endpoint)
Routing\DynamicControllerEndpointSelector.cs (7)
12private readonly DataSourceDependentCache<ActionSelectionTable<Endpoint>> _cache; 18_cache = new DataSourceDependentCache<ActionSelectionTable<Endpoint>>(dataSource, Initialize); 21private ActionSelectionTable<Endpoint> Table => _cache.EnsureInitialized(); 23public IReadOnlyList<Endpoint> SelectEndpoints(RouteValueDictionary values) 32private static ActionSelectionTable<Endpoint> Initialize(IReadOnlyList<Endpoint> endpoints) 34return ActionSelectionTable<Endpoint>.Create(endpoints);
Routing\DynamicControllerEndpointSelectorCache.cs (1)
26public DynamicControllerEndpointSelector GetEndpointSelector(Endpoint endpoint)
Routing\DynamicRouteValueTransformer.cs (7)
23/// <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> as well as 33/// <item><description><see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /></description></item> 77/// Implementations of <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> may further 82/// <see cref="FilterAsync(HttpContext, RouteValueDictionary, IReadOnlyList{Endpoint})" /> will not be called in the case 86public virtual ValueTask<IReadOnlyList<Endpoint>> FilterAsync(HttpContext httpContext, RouteValueDictionary values, IReadOnlyList<Endpoint> endpoints) 88return new ValueTask<IReadOnlyList<Endpoint>>(endpoints);
Routing\EndpointRoutingUrlHelper.cs (1)
96public Endpoint[] Items => _helper._endpointDataSource.Endpoints.ToArray();
Routing\UrlHelperFactory.cs (1)
43var endpoint = httpContext.GetEndpoint();
src\Http\Routing\src\DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
Microsoft.AspNetCore.Mvc.Core.Test (44)
ApplicationModels\EndpointMetadataProviderTest.cs (13)
35var endpoint = GetEndpoint(controllerType, actionName); 57var endpoint = GetEndpoint(typeof(TestController), nameof(TestController.ActionWithParameterMetadata)); 79var endpoint = GetEndpoint(typeof(TestController), nameof(TestController.ActionWithParameterMetadata)); 116var endpoint = Assert.Single(FilterEndpoints(dataSource.GetGroupedEndpoints(routeGroupContext))); 155var endpoint = Assert.Single(FilterEndpoints(dataSource.GetGroupedEndpoints(routeGroupContext))); 176var endpoint = Assert.Single(FilterEndpoints(dataSource.GetGroupedEndpoints(routeGroupContext))); 197var endpoint = Assert.Single(FilterEndpoints(dataSource.GetGroupedEndpoints(routeGroupContext))); 215private Endpoint GetEndpoint(Type controllerType, string actionName) => Assert.Single(GetEndpoints(controllerType, actionName)); 216private List<Endpoint> GetEndpoints(Type controllerType, string actionName) => FilterEndpoints(GetEndpointDataSource(controllerType, actionName).Endpoints); 220private List<Endpoint> FilterEndpoints(IReadOnlyList<Endpoint> endpoints) 222var nonLinkGenerationEndpoints = new List<Endpoint>(); 224foreach (var endpoint in endpoints)
Infrastructure\ActionSelectionTableTest.cs (1)
551private static ActionSelectionTable<Endpoint> CreateTableWithEndpoints(IReadOnlyList<ActionDescriptor> actions)
Routing\ActionEndpointFactoryTest.cs (8)
272var endpoints = new List<Endpoint>(); 373Assert.IsType<Endpoint>(Assert.Single(endpoints)); 378var endpoints = new List<Endpoint>(); 401var endpoints = new List<Endpoint>(); 420private IReadOnlyList<Endpoint> CreateConventionalRoutedEndpoints(ActionDescriptor action, ConventionalRouteEntry route) 425private IReadOnlyList<Endpoint> CreateConventionalRoutedEndpoints(ActionDescriptor action, IReadOnlyList<ConventionalRouteEntry> routes, bool createInertEndpoints = false) 427var endpoints = new List<Endpoint>(); 493private void AssertMatchingSuppressed(Endpoint endpoint, bool suppressed)
Routing\ControllerLinkGeneratorExtensionsTest.cs (3)
207private IServiceProvider CreateServices(IEnumerable<Endpoint> endpoints) 211endpoints = Enumerable.Empty<Endpoint>(); 224private LinkGenerator CreateLinkGenerator(params Endpoint[] endpoints)
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (13)
84private Endpoint[] ControllerEndpoints { get; } 86private Endpoint DynamicEndpoint { get; } 94private Func<HttpContext, RouteValueDictionary, object, IReadOnlyList<Endpoint>, ValueTask<IReadOnlyList<Endpoint>>> Filter { get; set; } = (_, __, ___, e) => new ValueTask<IReadOnlyList<Endpoint>>(e); 317return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>()); 354Filter = (c, values, state, endpoints) => new ValueTask<IReadOnlyList<Endpoint>>(new[] 416Filter = (c, values, state, endpoints) => new ValueTask<IReadOnlyList<Endpoint>>(new[] 449public Func<HttpContext, RouteValueDictionary, object, IReadOnlyList<Endpoint>, ValueTask<IReadOnlyList<Endpoint>>> Filter { get; set; } 456public override ValueTask<IReadOnlyList<Endpoint>> FilterAsync(HttpContext httpContext, RouteValueDictionary values, IReadOnlyList<Endpoint> endpoints)
Routing\EndpointRoutingUrlHelperTest.cs (3)
151return CreateServices(Enumerable.Empty<Endpoint>()); 277private IServiceProvider CreateServices(IEnumerable<Endpoint> endpoints) 281endpoints = Enumerable.Empty<Endpoint>();
Routing\PageLinkGeneratorExtensionsTest.cs (3)
177private IServiceProvider CreateServices(IEnumerable<Endpoint> endpoints) 181endpoints = Enumerable.Empty<Endpoint>(); 194private LinkGenerator CreateLinkGenerator(params Endpoint[] endpoints)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (3)
PageLoaderMatcherPolicy.cs (3)
33public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 68var endpoint = candidate.Endpoint; 109var endpoint = candidate.Endpoint;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
PageLoaderMatcherPolicyTest.cs (1)
87private static Endpoint CreateEndpoint(ActionDescriptor action)
Microsoft.AspNetCore.Mvc.RazorPages (16)
CompiledPageActionDescriptor.cs (1)
66public Endpoint? Endpoint { get; set; }
Infrastructure\DefaultPageLoader.cs (1)
65var endpoints = new List<Endpoint>();
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (4)
33public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 78var endpoint = candidates[i].Endpoint; 156var loadedEndpoints = new List<Endpoint>(endpoints); 179private DynamicPageEndpointSelector ResolveSelector(DynamicPageEndpointSelector? currentSelector, Endpoint endpoint)
Infrastructure\DynamicPageEndpointSelector.cs (7)
13private readonly DataSourceDependentCache<ActionSelectionTable<Endpoint>> _cache; 20_cache = new DataSourceDependentCache<ActionSelectionTable<Endpoint>>(dataSource, Initialize); 23private ActionSelectionTable<Endpoint> Table => _cache.EnsureInitialized(); 25public IReadOnlyList<Endpoint> SelectEndpoints(RouteValueDictionary values) 34private static ActionSelectionTable<Endpoint> Initialize(IReadOnlyList<Endpoint> endpoints) 36return ActionSelectionTable<Endpoint>.Create(endpoints);
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
27public DynamicPageEndpointSelector? GetEndpointSelector(Endpoint endpoint)
Infrastructure\PageActionEndpointDataSource.cs (2)
44protected override List<Endpoint> CreateEndpoints( 52var endpoints = new List<Endpoint>();
Microsoft.AspNetCore.Mvc.RazorPages.Test (14)
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (14)
97private Endpoint[] PageEndpoints { get; } 99private Endpoint DynamicEndpoint { get; } 101private Endpoint[] LoadedEndpoints { get; } 113private Func<HttpContext, RouteValueDictionary, object, IReadOnlyList<Endpoint>, ValueTask<IReadOnlyList<Endpoint>>> Filter { get; set; } = (_, __, ___, e) => new ValueTask<IReadOnlyList<Endpoint>>(e); 320return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>()); 356Filter = (c, values, state, endpoints) => new ValueTask<IReadOnlyList<Endpoint>>(new[] 416Filter = (c, values, state, endpoints) => new ValueTask<IReadOnlyList<Endpoint>>(new[] 449public Func<HttpContext, RouteValueDictionary, object, IReadOnlyList<Endpoint>, ValueTask<IReadOnlyList<Endpoint>>> Filter { get; set; } 451public override ValueTask<IReadOnlyList<Endpoint>> FilterAsync(HttpContext httpContext, RouteValueDictionary values, IReadOnlyList<Endpoint> endpoints)
Microsoft.AspNetCore.Mvc.Test (1)
Routing\ActionConstraintMatcherPolicyTest.cs (1)
471private static Endpoint CreateEndpoint(ActionDescriptor action)
Microsoft.AspNetCore.OpenApi (4)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (3)
17/// Extension methods for annotating OpenAPI descriptions on an <see cref="Endpoint" />. 24/// Adds an OpenAPI annotation to <see cref="Endpoint.Metadata" /> associated 42/// Adds an OpenAPI annotation to <see cref="Endpoint.Metadata" /> associated
Services\OpenApiGenerator.cs (1)
53/// Generates an <see cref="OpenApiOperation"/> for a given <see cref="Endpoint" />.
Microsoft.AspNetCore.OpenApi.Tests (6)
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (5)
32var endpoint = Assert.Single(dataSource.Endpoints); 55var endpoint = Assert.Single(dataSource.Endpoints); 82var endpoint = Assert.Single(dataSource.Endpoints); 137var endpoint = Assert.Single(groupDataSource.Endpoints); 175var endpoint = Assert.Single(groupDataSource.Endpoints);
Services\OpenApiGeneratorTests.cs (1)
1113public override Endpoint Build()
Microsoft.AspNetCore.RateLimiting (1)
RateLimitingMiddleware.cs (1)
67var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.RateLimiting.Tests (21)
RateLimiterEndpointConventionBuilderExtensionsTests.cs (3)
27var endpoint = endpointModel.Build(); 49var endpoint = endpointBuilder.Build(); 71var endpoint = endpointModel.Build();
RateLimitingMetricsTests.cs (2)
198var endpoint = routeEndpointBuilder.Build(); 273var endpoint = routeEndpointBuilder.Build();
RateLimitingMiddlewareTests.cs (15)
174var endpoint = CreateEndpointWithRateLimitPolicy(name); 205var endpoint = CreateEndpointWithRateLimitPolicy(name); 241var endpoint = CreateEndpointWithRateLimitPolicy(name); 272var endpoint = CreateEndpointWithRateLimitPolicy(name); 304var endpoint = CreateEndpointWithRateLimitPolicy(name); 336var endpoint = CreateEndpointWithRateLimitPolicy(name); 368var endpoint = CreateEndpointWithRateLimitPolicy(name); 411var endpoint = CreateEndpointWithRateLimitPolicy(name); 445var endpoint1 = CreateEndpointWithRateLimitPolicy(endpointName1); 446var endpoint2 = CreateEndpointWithRateLimitPolicy(endpointName2); 497var endpoint1 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName1)), "Test endpoint 1"); 498var endpoint2 = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(new EnableRateLimitingAttribute(endpointName2)), "Test endpoint 2"); 571var endpoint = CreateEndpointWithRateLimitPolicy(policy); 622private Endpoint CreateEndpointWithRateLimitPolicy<TPartitionKey>(IRateLimiterPolicy<TPartitionKey> policy) 633private Endpoint CreateEndpointWithRateLimitPolicy(string policy)
TestEndpointBuilder.cs (1)
16public override Endpoint Build()
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
73public Endpoint Endpoint { get; set; }
Microsoft.AspNetCore.RequestDecompression.Tests (1)
RequestDecompressionMiddlewareTests.cs (1)
767public Endpoint Endpoint { get; set; }
Microsoft.AspNetCore.Routing (266)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (7)
33/// made, and an <see cref="Endpoint"/> is associated with the <see cref="HttpContext"/>. The <see cref="EndpointMiddleware"/> 34/// defines a point in the middleware pipeline where the current <see cref="Endpoint"/> is executed. Middleware between 36/// <see cref="Endpoint"/> associated with the <see cref="HttpContext"/>. 68/// The <see cref="EndpointMiddleware"/> will execute the <see cref="Endpoint"/> associated with the current 82/// made, and an <see cref="Endpoint"/> is associated with the <see cref="HttpContext"/>. The <see cref="EndpointMiddleware"/> 83/// defines a point in the middleware pipeline where the current <see cref="Endpoint"/> is executed. Middleware between 85/// <see cref="Endpoint"/> associated with the <see cref="HttpContext"/>.
Builder\OpenApiRouteHandlerBuilderExtensions.cs (1)
12/// Extension methods for adding <see cref="Endpoint.Metadata"/> that is
CompositeEndpointDataSource.cs (8)
22private List<Endpoint>? _endpoints; 57/// Gets a <see cref="IChangeToken"/> used to signal invalidation of cached <see cref="Endpoint"/> instances. 67/// Returns a read-only collection of <see cref="Endpoint"/> instances. 69public override IReadOnlyList<Endpoint> Endpoints 79public override IReadOnlyList<Endpoint> GetGroupedEndpoints(RouteGroupContext context) 83return Array.Empty<Endpoint>(); 89var groupedEndpoints = new List<Endpoint>(); 265var endpoints = new List<Endpoint>();
DataSourceDependentCache.cs (2)
16private readonly Func<IReadOnlyList<Endpoint>, T> _initializeCore; 27public DataSourceDependentCache(EndpointDataSource dataSource, Func<IReadOnlyList<Endpoint>, T> initialize)
DataTokensMetadata.cs (1)
12/// Metadata that defines data tokens for an <see cref="Endpoint"/>. This metadata
DefaultEndpointDataSource.cs (11)
12/// Provides a collection of <see cref="Endpoint"/> instances. 17private readonly IReadOnlyList<Endpoint> _endpoints; 22/// <param name="endpoints">The <see cref="Endpoint"/> instances that the data source will return.</param> 23public DefaultEndpointDataSource(params Endpoint[] endpoints) 27_endpoints = (Endpoint[])endpoints.Clone(); 33/// <param name="endpoints">The <see cref="Endpoint"/> instances that the data source will return.</param> 34public DefaultEndpointDataSource(IEnumerable<Endpoint> endpoints) 38_endpoints = new List<Endpoint>(endpoints); 42/// Gets a <see cref="IChangeToken"/> used to signal invalidation of cached <see cref="Endpoint"/> 49/// Returns a read-only collection of <see cref="Endpoint"/> instances. 51public override IReadOnlyList<Endpoint> Endpoints => _endpoints;
DefaultLinkGenerator.cs (5)
327private IReadOnlyList<Endpoint> Endpoints => _serviceProvider.GetRequiredService<EndpointDataSource>().Endpoints; 334public Endpoint[] Items => _generator.Endpoints.ToArray(); 339public static void EndpointsFound(ILogger logger, object? address, IEnumerable<Endpoint> endpoints) 412public static void LinkGenerationSucceeded(ILogger logger, IEnumerable<Endpoint> endpoints, string uri) 427public static void LinkGenerationFailed(ILogger logger, IEnumerable<Endpoint> endpoints)
DefaultLinkParser.cs (3)
172public static void EndpointsFound(ILogger logger, object? address, IEnumerable<Endpoint> endpoints) 187public static void PathParsingSucceeded(ILogger logger, PathString path, Endpoint endpoint) 199public static void PathParsingFailed(ILogger logger, PathString path, IEnumerable<Endpoint> endpoints)
EndpointDataSource.cs (11)
12/// Provides a collection of <see cref="Endpoint"/> instances. 17/// Gets a <see cref="IChangeToken"/> used to signal invalidation of cached <see cref="Endpoint"/> 24/// Returns a read-only collection of <see cref="Endpoint"/> instances. 26public abstract IReadOnlyList<Endpoint> Endpoints { get; } 29/// Get the <see cref="Endpoint"/> instances for this <see cref="EndpointDataSource"/> given the specified <see cref="RouteGroupContext.Prefix"/> and <see cref="RouteGroupContext.Conventions"/>. 31/// <param name="context">Details about how the returned <see cref="Endpoint"/> instances should be grouped and a reference to application services.</param> 33/// Returns a read-only collection of <see cref="Endpoint"/> instances given the specified group <see cref="RouteGroupContext.Prefix"/> and <see cref="RouteGroupContext.Conventions"/>. 35public virtual IReadOnlyList<Endpoint> GetGroupedEndpoints(RouteGroupContext context) 43var endpoint = endpoints[i]; 89internal static string GetDebuggerDisplayStringForEndpoints(IReadOnlyList<Endpoint>? endpoints) 98foreach (var endpoint in endpoints)
EndpointGroupNameAttribute.cs (1)
7/// Specifies the endpoint group name in <see cref="Microsoft.AspNetCore.Http.Endpoint.Metadata"/>.
EndpointMiddleware.cs (7)
35var endpoint = httpContext.GetEndpoint(); 91static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger) 104private static void ThrowMissingAuthMiddlewareException(Endpoint endpoint) 112private static void ThrowMissingCorsMiddlewareException(Endpoint endpoint) 120private static void ThrowMissingAntiforgeryMiddlewareException(Endpoint endpoint) 132public static partial void ExecutingEndpoint(ILogger logger, Endpoint endpointName); 135public static partial void ExecutedEndpoint(ILogger logger, Endpoint endpointName);
EndpointNameAddressScheme.cs (12)
12private readonly DataSourceDependentCache<FrozenDictionary<string, Endpoint[]>> _cache; 16_cache = new DataSourceDependentCache<FrozenDictionary<string, Endpoint[]>>(dataSource, Initialize); 20internal FrozenDictionary<string, Endpoint[]> Entries => _cache.EnsureInitialized(); 22public IEnumerable<Endpoint> FindEndpoints(string address) 30return result ?? Array.Empty<Endpoint>(); 33private static FrozenDictionary<string, Endpoint[]> Initialize(IReadOnlyList<Endpoint> endpoints) 38var entries = new Dictionary<string, Endpoint[]>(StringComparer.Ordinal); 41var endpoint = endpoints[i]; 61var newEntry = new Endpoint[existing.Length + 1]; 85foreach (var endpoint in group.Value) 94static string? GetEndpointName(Endpoint endpoint)
EndpointNameAttribute.cs (1)
9/// Specifies the endpoint name in <see cref="Endpoint.Metadata"/>.
EndpointNameMetadata.cs (1)
11/// Specifies an endpoint name in <see cref="Endpoint.Metadata"/>.
EndpointRoutingMiddleware.cs (13)
62var endpoint = httpContext.GetEndpoint(); 104var endpoint = httpContext.GetEndpoint(); 158private Task ExecuteShortCircuit(ShortCircuitMetadata shortCircuitMetadata, Endpoint endpoint, HttpContext httpContext) 214static async Task AwaitRequestTask(Endpoint endpoint, Task requestTask, ILogger logger) 284private static void ThrowCannotShortCircuitAnAuthRouteException(Endpoint endpoint) 290private static void ThrowCannotShortCircuitACorsRouteException(Endpoint endpoint) 296private static void ThrowCannotShortCircuitAnAntiforgeryRouteException(Endpoint endpoint) 339public static void MatchSuccess(ILogger logger, Endpoint endpoint) 348public static void MatchSkipped(ILogger logger, Endpoint endpoint) 355public static partial void ExecutingEndpoint(ILogger logger, Endpoint endpointName); 358public static partial void ExecutedEndpoint(ILogger logger, Endpoint endpointName); 361public static partial void ShortCircuitedEndpoint(ILogger logger, Endpoint endpointName); 364public static partial void FallbackMatch(ILogger logger, Endpoint endpointName);
ExcludeFromDescriptionAttribute.cs (1)
11/// Indicates that this <see cref="Endpoint"/> should not be included in the generated API metadata.
IDataTokenMetadata.cs (1)
9/// Metadata that defines data tokens for an <see cref="Endpoint"/>. This metadata
IDynamicEndpointMetadata.cs (2)
10/// A metadata interface that can be used to specify that the associated <see cref="Endpoint" /> 16/// <see cref="MatcherPolicy"/> implementations that an <see cref="Endpoint"/> has dynamic behavior
IEndpointAddressScheme.cs (2)
18/// <returns>A collection of <see cref="Endpoint"/>.</returns> 19IEnumerable<Endpoint> FindEndpoints(TAddress address);
IEndpointGroupNameMetadata.cs (1)
9/// Defines a contract used to specify an endpoint group name in <see cref="Endpoint.Metadata"/>.
IEndpointNameMetadata.cs (1)
9/// Defines a contract use to specify an endpoint name in <see cref="Endpoint.Metadata"/>.
LinkParser.cs (2)
15/// specified by the <see cref="Endpoint"/> matching <paramref name="address"/>. 27/// <see cref="Endpoint"/> instances that match <paramref name="address"/> and then use the route
LinkParserEndpointNameAddressExtensions.cs (2)
15/// specified by the <see cref="Endpoint"/> matching <paramref name="endpointName"/>. 27/// <see cref="Endpoint"/> instances that match <paramref name="endpointName"/> and then use the route
Matching\AcceptsMatcherPolicy.cs (12)
13private static Endpoint? Http415Endpoint; 20public IComparer<Endpoint> Comparer { get; } = new ConsumesMetadataEndpointComparer(); 22bool INodeBuilderPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 34bool IEndpointSelectorPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 42private static bool AppliesToEndpointsCore(IReadOnlyList<Endpoint> endpoints) 138public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 150var edges = new Dictionary<string, List<Endpoint>>(StringComparer.OrdinalIgnoreCase); 153var endpoint = endpoints[i]; 166edges.Add(contentType, new List<Endpoint>()); 175var endpoint = endpoints[i]; 224edges.Add(AnyContentType, new List<Endpoint>() 249private static Endpoint CreateRejectionEndpoint()
Matching\Candidate.cs (3)
11public readonly Endpoint Endpoint; 50public Candidate(Endpoint endpoint) 65Endpoint endpoint,
Matching\CandidateSet.cs (15)
14/// Represents a set of <see cref="Endpoint"/> candidates that have been matched 35public CandidateSet(Endpoint[] endpoints, RouteValueDictionary[] values, int[] scores) 74/// Gets the <see cref="CandidateState"/> associated with the candidate <see cref="Endpoint"/> 101/// Gets a value which indicates where the <see cref="Http.Endpoint"/> is considered 152/// Replaces the <see cref="Endpoint"/> at the provided <paramref name="index"/> with the 157/// The <see cref="Endpoint"/> to replace the original <see cref="Endpoint"/> at 165public void ReplaceEndpoint(int index, Endpoint? endpoint, RouteValueDictionary? values) 184/// Replaces the <see cref="Endpoint"/> at the provided <paramref name="index"/> with the 189/// The list of endpoints <see cref="Endpoint"/> to replace the original <see cref="Endpoint"/> at 208public void ExpandEndpoint(int index, IReadOnlyList<Endpoint> endpoints, IComparer<Endpoint> comparer) 278Array.Sort<Endpoint>(buffer, comparer); 339var duplicates = new List<Endpoint>();
Matching\CandidateState.cs (6)
13internal CandidateState(Endpoint endpoint, int score) 20internal CandidateState(Endpoint endpoint, RouteValueDictionary? values, int score) 28/// Gets the <see cref="Http.Endpoint"/>. 30public Endpoint Endpoint { get; } 33/// Gets the score of the <see cref="Http.Endpoint"/> within the current 51/// <see cref="Http.Endpoint"/> and the current request.
Matching\ContentEncodingNegotiationMatcherPolicy.cs (3)
13private protected override bool HasMetadata(Endpoint endpoint) => endpoint.Metadata.GetMetadata<ContentEncodingMetadata>() != null; 15private protected override string? GetMetadataValue(Endpoint endpoint) => endpoint.Metadata.GetMetadata<ContentEncodingMetadata>()?.Value; 23private protected override double? GetMetadataQuality(Endpoint endpoint)
Matching\DataSourceDependentMatcher.cs (1)
38private Matcher CreateMatcher(IReadOnlyList<Endpoint> endpoints)
Matching\DefaultEndpointSelector.cs (2)
60Endpoint? endpoint = null; 111var matches = new List<Endpoint>();
Matching\DfaMatcher.cs (7)
276Endpoint endpoint, 298Endpoint endpoint, 364public static void CandidateRejectedByComplexSegment(ILogger logger, string path, Endpoint endpoint, RoutePatternPathSegment segment) 380public static void CandidateRejectedByConstraint(ILogger logger, string path, Endpoint endpoint, string constraintName, IRouteConstraint constraint, object? value) 396public static void CandidateNotValid(ILogger logger, string path, Endpoint endpoint) 412public static void CandidateValid(ILogger logger, string path, Endpoint endpoint) 428private static string GetRoutePattern(Endpoint endpoint)
Matching\DfaMatcherBuilder.cs (8)
705internal Candidate[] CreateCandidates(IReadOnlyList<Endpoint> endpoints) 715var examplar = endpoints[0]; 720var endpoint = endpoints[i]; 735internal Candidate CreateCandidate(Endpoint endpoint, int score) 911if (!nodeBuilder.AppliesToEndpoints(parent.Matches ?? (IReadOnlyList<Endpoint>)Array.Empty<Endpoint>())) 921var edges = nodeBuilder.GetEdges(parent.Matches ?? (IReadOnlyList<Endpoint>)Array.Empty<Endpoint>());
Matching\DfaNode.cs (5)
26public List<Endpoint> Matches { get; private set; } 58public void AddMatch(Endpoint endpoint) 62Matches = new List<Endpoint>(); 68public void AddMatches(IEnumerable<Endpoint> endpoints) 72Matches = new List<Endpoint>(endpoints);
Matching\EndpointComparer.cs (21)
23internal sealed class EndpointComparer : IComparer<Endpoint>, IEqualityComparer<Endpoint> 25private readonly IComparer<Endpoint>[] _comparers; 30_comparers = new IComparer<Endpoint>[2 + policies.Length]; 39public int Compare(Endpoint? x, Endpoint? y) 52private static int ComparePattern(Endpoint x, Endpoint y) 75public bool Equals(Endpoint? x, Endpoint? y) 85public int GetHashCode(Endpoint obj) 92private int CompareCore(Endpoint x, Endpoint y) 106private sealed class OrderComparer : IComparer<Endpoint> 108public static readonly IComparer<Endpoint> Instance = new OrderComparer(); 110public int Compare(Endpoint? x, Endpoint? y) 133private sealed class PrecedenceComparer : IComparer<Endpoint> 135public static readonly IComparer<Endpoint> Instance = new PrecedenceComparer(); 137public int Compare(Endpoint? x, Endpoint? y)
Matching\EndpointMetadataComparer.cs (15)
13/// A comparer that can order <see cref="Endpoint"/> instances based on implementations of 15/// provider and provided to <see cref="CandidateSet.ExpandEndpoint(int, IReadOnlyList{Endpoint}, IComparer{Endpoint})"/>. 17public sealed class EndpointMetadataComparer : IComparer<Endpoint> 20private IComparer<Endpoint>[]? _comparers; 31private IComparer<Endpoint>[] Comparers 48int IComparer<Endpoint>.Compare(Endpoint? x, Endpoint? y) 69/// a specific type of metadata from <see cref="Endpoint.Metadata"/> for comparison. 76public abstract class EndpointMetadataComparer<TMetadata> : IComparer<Endpoint> where TMetadata : class 94public int Compare(Endpoint? x, Endpoint? y) 105/// <param name="endpoint">The <see cref="Endpoint"/>.</param> 107protected virtual TMetadata? GetMetadata(Endpoint endpoint)
Matching\EndpointSelector.cs (3)
9/// A service that is responsible for the final <see cref="Endpoint"/> selection 16/// Asynchronously selects an <see cref="Endpoint"/> from the <see cref="CandidateSet"/>. 23/// <see cref="EndpointHttpContextExtensions.SetEndpoint(HttpContext, Endpoint)"/>
Matching\HostMatcherPolicy.cs (10)
24public IComparer<Endpoint> Comparer { get; } = new HostMetadataEndpointComparer(); 26bool INodeBuilderPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 33bool IEndpointSelectorPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 46private static bool AppliesToEndpointsCore(IReadOnlyList<Endpoint> endpoints) 186public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 198var edges = new Dictionary<EdgeKey, List<Endpoint>>(); 201var endpoint = endpoints[i]; 213edges.Add(host, new List<Endpoint>()); 222var endpoint = endpoints[i]; 272private static EdgeKey[]? GetEdgeKeys(Endpoint endpoint)
Matching\HttpMethodMatcherPolicy.cs (14)
30public IComparer<Endpoint> Comparer => new HttpMethodMetadataEndpointComparer(); 39bool INodeBuilderPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 51bool IEndpointSelectorPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 59private static bool AppliesToEndpointsCore(IReadOnlyList<Endpoint> endpoints) 164public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 175var edges = new Dictionary<EdgeKey, List<Endpoint>>(); 178var endpoint = endpoints[i]; 197edges.Add(key, new List<Endpoint>()); 207edges.Add(key, new List<Endpoint>()); 228var endpoint = endpoints[i]; 284var endpoint = CreateRejectionEndpoint(allHttpMethods); 285var matches = new List<Endpoint>() { endpoint, }; 298static (IReadOnlyList<string> httpMethods, bool acceptCorsPreflight) GetHttpMethods(Endpoint e) 380private static Endpoint CreateRejectionEndpoint(IEnumerable<string>? httpMethods)
Matching\IEndpointComparerPolicy.cs (1)
32IComparer<Endpoint> Comparer { get; }
Matching\IEndpointSelectorPolicy.cs (4)
20/// <param name="endpoints">The set of candidate <see cref="Endpoint"/> values.</param> 24bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints); 41/// calling <see cref="EndpointHttpContextExtensions.SetEndpoint(HttpContext, Endpoint)"/> 43/// <see cref="Endpoint"/> value that will produce the desired error when executed.
Matching\INodeBuilderPolicy.cs (4)
16/// <param name="endpoints">A list of <see cref="Endpoint"/>.</param> 18bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints); 23/// <param name="endpoints">A list of <see cref="Endpoint"/>.</param> 25IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints);
Matching\Matcher.cs (2)
9/// An interface for components that can select an <see cref="Endpoint"/> given the current request, as part 15/// Attempts to asynchronously select an <see cref="Endpoint"/> for the current request.
Matching\MatcherPolicy.cs (1)
47protected static bool ContainsDynamicEndpoints(IReadOnlyList<Endpoint> endpoints)
Matching\NegotiationMatcherPolicy.cs (14)
15private static Endpoint? Http406Endpoint; 22public IComparer<Endpoint> Comparer => new NegotiationMetadataEndpointComparer(); 24bool INodeBuilderPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) => 27bool IEndpointSelectorPolicy.AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) => 30private bool AppliesToEndpointsCore(IReadOnlyList<Endpoint> endpoints) 34var endpoint = endpoints[i]; 45private protected abstract bool HasMetadata(Endpoint endpoint); 47private protected abstract string? GetMetadataValue(Endpoint endpoint); 53private protected abstract double? GetMetadataQuality(Endpoint endpoint); 222public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 234var edges = new Dictionary<string, List<Endpoint>>(StringComparer.OrdinalIgnoreCase); 237var endpoint = endpoints[i]; 249var endpoint = endpoints[i]; 310private static Endpoint CreateRejectionEndpoint() =>
Matching\PolicyNodeEdge.cs (2)
18public PolicyNodeEdge(object state, IReadOnlyList<Endpoint> endpoints) 27public IReadOnlyList<Endpoint> Endpoints { get; }
RouteEndpoint.cs (1)
10/// Represents an <see cref="Endpoint"/> that can be used in URL matching or URL generation.
RouteEndpointBuilder.cs (1)
48public override Endpoint Build()
RouteGroupBuilder.cs (6)
50public override IReadOnlyList<Endpoint> Endpoints => 54public override IReadOnlyList<Endpoint> GetGroupedEndpoints(RouteGroupContext context) => 57public IReadOnlyList<Endpoint> GetGroupedEndpointsWithNullablePrefix( 650 => Array.Empty<Endpoint>(), 107private IReadOnlyList<Endpoint> SelectEndpointsFromAllDataSources(RouteGroupContext context) 109var groupedEndpoints = new List<Endpoint>();
RouteValuesAddressScheme.cs (5)
23public IEnumerable<Endpoint> FindEndpoints(RouteValuesAddress address) 59return Array.Empty<Endpoint>(); 62private static IEnumerable<Endpoint> GetEndpoints(IList<OutboundMatchResult> matchResults, int matchCount) 70private StateEntry Initialize(IReadOnlyList<Endpoint> endpoints) 94var endpoint = endpoints[i];
src\Shared\HttpExtensions.cs (4)
36internal static Endpoint? GetOriginalEndpoint(HttpContext context) 38var endpoint = context.GetEndpoint(); 42if (endpoint == null && context.Items.TryGetValue(OriginalEndpointKey, out var e) && e is Endpoint originalEndpoint) 51var endpoint = context.GetEndpoint();
Microsoft.AspNetCore.Routing.Abstractions (1)
Properties\AssemblyInfo.cs (1)
11[assembly: TypeForwardedTo(typeof(Endpoint))]
Microsoft.AspNetCore.Routing.FunctionalTests (2)
RouteHandlerTest.cs (2)
121public override IReadOnlyList<Endpoint> Endpoints => Array.Empty<Endpoint>();
Microsoft.AspNetCore.Routing.Microbenchmarks (23)
EndpointRoutingBenchmarkBase.cs (2)
68private protected void Validate(HttpContext httpContext, Endpoint expected, Endpoint actual)
EndpointRoutingShortCircuitBenchmark.cs (7)
27var normalEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(), "normal"); 39var shortCircuitEndpoint = new Endpoint(context => Task.CompletedTask, new EndpointMetadataCollection(new ShortCircuitMetadata(200)), "shortcircuit"); 69private readonly Endpoint _endpoint; 71public BenchmarkMatcherFactory(Endpoint endpoint) 83private Endpoint _endpoint; 85public BenchmarkMatcher(Endpoint endpoint) 111public override IReadOnlyList<Endpoint> Endpoints => throw new NotImplementedException();
LinkGeneration\SingleRouteRouteValuesAddressSchemeBenchmark.cs (3)
60private readonly Endpoint _endpoint; 62public TestAddressScheme(Endpoint endpoint) 67public IEnumerable<Endpoint> FindEndpoints(int address)
Matching\MatcherBuilderMultipleEntryBenchmark.cs (11)
109public IComparer<Endpoint> Comparer => new TestEndpointComparer(); 111public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 121public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 133public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 143public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 155public IComparer<Endpoint> Comparer => new TestEndpointComparer(); 157public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 174public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 197private sealed class TestEndpointComparer : IComparer<Endpoint> 199public int Compare(Endpoint x, Endpoint y)
Microsoft.AspNetCore.Routing.Tests (195)
Builder\FallbackEndpointRouteBuilderExtensionsTest.cs (2)
26var endpoint = Assert.Single(dataSource.Endpoints); 42var endpoint = Assert.Single(dataSource.Endpoints);
Builder\GroupTest.cs (9)
34var endpoint = Assert.Single(dataSource.Endpoints); 66var endpoint = Assert.Single(dataSource.Endpoints); 100var endpoint = Assert.Single(dataSource.Endpoints); 214Endpoint? conventionBuiltEndpoint = null; 222var endpoint = Assert.Single(dataSource.Endpoints); 250var endpoint = Assert.Single(dataSource.Endpoints); 286var endpoint = Assert.Single(dataSource.Endpoints); 329var endpoint = Assert.Single(dataSource.Endpoints); 393public override IReadOnlyList<Endpoint> Endpoints => new[] { new TestCustomEndpoint() };
Builder\OpenApiRouteHandlerBuilderExtensionsTest.cs (1)
156public override Endpoint Build() => throw new NotImplementedException();
Builder\RequestDelegateEndpointRouteBuilderExtensionsTest.cs (11)
99var endpoint = Assert.Single(dataSource.Endpoints); // Triggers build and construction of delegate 133var endpoint = Assert.Single(dataSource.Endpoints); 161var endpoint = Assert.Single(dataSource.Endpoints); 212var endpoint = Assert.Single(dataSource.Endpoints); 247var endpoint = Assert.Single(dataSource.Endpoints); 281var endpoint = Assert.Single(dataSource.Endpoints); 341var endpoint = Assert.Single(dataSource.Endpoints); 410var endpoint = Assert.Single(dataSource.Endpoints); 447var endpoint = ds.Endpoints.Single(); 465var endpoint = Assert.Single(ds.Endpoints); 485var endpoint = Assert.Single(ds.Endpoints);
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (33)
78var endpoint = Assert.Single(dataSource.Endpoints); 100var endpoint = Assert.Single(dataSource.Endpoints); 120var endpoint = Assert.Single(dataSource.Endpoints); 146var endpoint = Assert.Single(dataSource.Endpoints); 184var endpoint = Assert.Single(dataSource.Endpoints); 268var endpoint = Assert.Single(dataSource.Endpoints); 288var endpoint = Assert.Single(dataSource.Endpoints); 308var endpoint = Assert.Single(dataSource.Endpoints); 332var endpoint = Assert.Single(dataSource.Endpoints); 352var endpoint = Assert.Single(dataSource.Endpoints); 372var endpoint = Assert.Single(dataSource.Endpoints); 396var endpoint = Assert.Single(dataSource.Endpoints); 416var endpoint = Assert.Single(dataSource.Endpoints); 436var endpoint = Assert.Single(dataSource.Endpoints); 463var endpoint = Assert.Single(dataSource.Endpoints); 489var endpoint = Assert.Single(dataSource.Endpoints); 519var endpoint = Assert.Single(dataSource.Endpoints); 561var endpoint = Assert.Single(dataSource.Endpoints); 611var endpoint = Assert.Single(dataSource.Endpoints); 634var endpoint = Assert.Single(dataSource.Endpoints); 666var endpoint = Assert.Single(dataSource.Endpoints); 686var endpoint = Assert.Single(dataSource.Endpoints); 704var endpoint = Assert.Single(dataSource.Endpoints); 724var endpoint = Assert.Single(dataSource.Endpoints); 744var endpoint = Assert.Single(dataSource.Endpoints); 760var endpoint = Assert.Single(dataSource.Endpoints); 780var endpoint = Assert.Single(dataSource.Endpoints); 795var endpoint = Assert.Single(dataSource.Endpoints); 818var endpoint = Assert.Single(dataSource.Endpoints); 845var endpoint = Assert.Single(dataSource.Endpoints); 890private static async Task AssertIdAsync(Endpoint endpoint, string expectedPattern, int expectedId) 924var endpoint = Assert.Single(dataSource.Endpoints); 969var endpoint = Assert.Single(dataSource.Endpoints);
Builder\RoutingEndpointConventionBuilderExtensionsTest.cs (10)
42var endpoint = builder.Build(); 72var endpoint = builder.Build(); 99var endpoint = builder.Build(); 113var endpoint = builder.Build(); 147var endpoint = builder.Build(); 166var endpoint = builder.Build(); 189var endpoint = builder.Build(); 220var endpoint = builder.Build(); 272public Endpoint Build() 309public Endpoint Build()
CompositeEndpointDataSourceTest.cs (10)
24var dataSource = new DefaultEndpointDataSource(new Endpoint[] { endpoint1, endpoint2 }); 94new DefaultEndpointDataSource(new Endpoint[] { endpoint1, endpoint2 }), 95new DefaultEndpointDataSource(new Endpoint[] { endpoint3, endpoint4 }), 96new DefaultEndpointDataSource(new Endpoint[] { endpoint5 }), 124var endpoint = Assert.Single(endpoints); 510public TestGroupDataSource(params Endpoint[] endpoints) => Endpoints = endpoints; 512public override IReadOnlyList<Endpoint> Endpoints { get; } 516public List<IReadOnlyList<Endpoint>> ResolvedGroupedEndpoints { get; } = new(); 518public override IReadOnlyList<Endpoint> GetGroupedEndpoints(RouteGroupContext context) 538public override IReadOnlyList<Endpoint> Endpoints => throw _ex;
DefaultEndpointDataSourceTests.cs (9)
29var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"); 30var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2"); 47Endpoint[] endpoints = null; 57var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 73var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "1"); 74var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "2"); 75var endpoints = new List<Endpoint> { endpoint1, endpoint2 }; 78var dataSource = new DefaultEndpointDataSource((IEnumerable<Endpoint>)endpoints); 91IEnumerable<Endpoint> endpoints = null;
DefaultLinkGeneratorTest.cs (1)
743public IEnumerable<Endpoint> FindEndpoints(int address)
DefaultLinkParserTest.cs (1)
172public IEnumerable<Endpoint> FindEndpoints(int address)
EndpointNameAddressSchemeTest.cs (2)
154var endpoints = new Endpoint[] 186private EndpointNameAddressScheme CreateAddressScheme(params Endpoint[] endpoints)
EndpointRoutingMiddlewareFormOptionsTest.cs (2)
139var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp"); 171var endpoint = new Endpoint(c => Task.CompletedTask, new EndpointMetadataCollection(endpointMetadata), "myapp");
EndpointRoutingMiddlewareTest.cs (1)
53var endpoint = httpContext.GetEndpoint();
LinkGeneratorIntegrationTest.cs (2)
17var endpoints = new List<Endpoint>() 206private IReadOnlyList<Endpoint> Endpoints { get; }
LinkGeneratorTestBase.cs (3)
34private protected DefaultLinkGenerator CreateLinkGenerator(params Endpoint[] endpoints) 41params Endpoint[] endpoints) 43return CreateLinkGenerator(configureServices, new[] { new DefaultEndpointDataSource(endpoints ?? Array.Empty<Endpoint>()) });
LinkParserTestBase.cs (3)
26private protected DefaultLinkParser CreateLinkParser(params Endpoint[] endpoints) 33params Endpoint[] endpoints) 35return CreateLinkParser(configureServices, new[] { new DefaultEndpointDataSource(endpoints ?? Array.Empty<Endpoint>()) });
MatcherPolicyTest.cs (4)
15var endpoints = new Endpoint[] 33var endpoints = new Endpoint[] 51var endpoints = new Endpoint[] { }; 84public static new bool ContainsDynamicEndpoints(IReadOnlyList<Endpoint> endpoints)
Matching\AcceptsMatcherPolicyTest.cs (1)
619private static CandidateSet CreateCandidateSet(Endpoint[] endpoints)
Matching\CandidateSetTest.cs (4)
98candidateSet.ReplaceEndpoint(i, (Endpoint)null, null); 128candidateSet.ExpandEndpoint(0, Array.Empty<Endpoint>(), comparer); 321var ex = Assert.Throws<InvalidOperationException>(() => candidateSet.ExpandEndpoint(0, Array.Empty<Endpoint>(), comparer)); 399public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata>.Default;
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (8)
366var endpoint = Assert.Single(e.Endpoints); 372var endpoint = Assert.Single(e.Endpoints); 411var endpoint = Assert.Single(e.Endpoints); 417var endpoint = Assert.Single(e.Endpoints); 619private static ContentEncodingNegotiationMatcherPolicy.NegotiationPolicyJumpTable CreateJumpTable(INodeBuilderPolicy policy, params Endpoint[] endpoints) 629private static CandidateSet CreateCandidateSet(params Endpoint[] endpoints) => new( 634private static Endpoint CreateEndpoint(string contentEncoding, double quality = 1.0d) 636var endpoint = new Endpoint(
Matching\DataSourceDependentMatcherTest.cs (1)
85var endpoint = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "test");
Matching\DfaMatcherBuilderTest.cs (13)
2934void VerifyOrder(IReadOnlyList<Endpoint> endpoints) 3587public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata1>.Default; 3589public Action<IReadOnlyList<Endpoint>> OnGetEdges { get; set; } 3591public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 3601public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 3629public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata2>.Default; 3631public Action<IReadOnlyList<Endpoint>> OnGetEdges { get; set; } 3633public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 3643public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 3657public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata1>.Default; 3659public bool AppliesToEndpoints(IReadOnlyList<Endpoint> endpoints) 3669public IReadOnlyList<PolicyNodeEdge> GetEdges(IReadOnlyList<Endpoint> endpoints) 3676var maxValueEndpoint = new Endpoint(TestConstants.EmptyRequestDelegate, EndpointMetadataCollection.Empty, "MaxValueEndpoint");
Matching\DfaMatcherTest.cs (33)
65var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 86var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 115var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 141var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 180var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 206var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 255var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 289var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 324var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 361var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 388var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 415var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 441var endpoints = new List<Endpoint> 467var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 493var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 520var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 546var endpoints = new List<Endpoint> 584var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 621var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 667var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 713var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 760var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 782var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 812var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 852var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 892var endpointDataSource = new DefaultEndpointDataSource(new List<Endpoint> 949var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 959.Setup(p => p.AppliesToEndpoints(It.IsAny<IReadOnlyList<Endpoint>>())).Returns(true); 985var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 995.Setup(p => p.AppliesToEndpoints(It.IsAny<IReadOnlyList<Endpoint>>())).Returns(false); 1020var dataSource = new DefaultEndpointDataSource(new List<Endpoint> 1030.Setup(p => p.AppliesToEndpoints(It.IsAny<IReadOnlyList<Endpoint>>())).Returns(true); 1047.Setup(p => p.AppliesToEndpoints(It.IsAny<IReadOnlyList<Endpoint>>())).Returns(true);
Matching\EndpointComparerTest.cs (2)
263public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata1>.Default; 272public IComparer<Endpoint> Comparer => EndpointMetadataComparer<TestMetadata2>.Default;
Matching\EndpointMetadataComparerTest.cs (11)
14var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 15var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2"); 28var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test1"); 29var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test2"); 42var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 43var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test2"); 56var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test1"); 57var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2"); 70var endpoint1 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { new TestMetadata(), }), "test1"); 71var endpoint2 = new Endpoint(TestConstants.EmptyRequestDelegate, new EndpointMetadataCollection(new object[] { }), "test2"); 73var list = new List<Endpoint>() { endpoint2, endpoint1, };
Matching\MatcherAssert.cs (5)
26public static void AssertMatch(HttpContext httpContext, Endpoint expected) 31public static void AssertMatch(HttpContext httpContext, Endpoint expected, bool ignoreValues) 36public static void AssertMatch(HttpContext httpContext, Endpoint expected, object values) 41public static void AssertMatch(HttpContext httpContext, Endpoint expected, string[] keys, string[] values) 57Endpoint expected,
RouteOptionsTests.cs (3)
37var endpoint1 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty); 38var endpoint2 = new Endpoint((c) => Task.CompletedTask, EndpointMetadataCollection.Empty, string.Empty); 47var result = Assert.Single(endpointDataSource.Endpoints);
RouteValuesAddressSchemeTest.cs (5)
199var actual = Assert.Single(foundEndpoints); 281var actual = Assert.Single(foundEndpoints); 304var actual = Assert.Single(foundEndpoints); 333var actual = Assert.Single(foundEndpoints); 415private RouteValuesAddressScheme CreateAddressScheme(params Endpoint[] endpoints)
TestObjects\DynamicEndpointDataSource.cs (5)
11private readonly List<Endpoint> _endpoints; 16public DynamicEndpointDataSource(params Endpoint[] endpoints) 18_endpoints = new List<Endpoint>(); 27public override IReadOnlyList<Endpoint> Endpoints => _endpoints; 30public void AddEndpoint(Endpoint endpoint)
Microsoft.AspNetCore.Security.Microbenchmarks (1)
AuthorizationMiddlewareBenchmark.cs (1)
48public Endpoint Endpoint { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Http\HttpProtocol.cs (1)
73private Endpoint? _endpoint;
Internal\Http\HttpProtocol.FeatureCollection.cs (1)
230Endpoint? IEndpointFeature.Endpoint
Microsoft.AspNetCore.StaticAssets (5)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
97var endpoint = _context.GetEndpoint()!;
StaticAssetEndpointDataSource.cs (3)
23private List<Endpoint> _endpoints = null!; 52public override IReadOnlyList<Endpoint> Endpoints 90var endpoints = new List<Endpoint>();
StaticAssetEndpointFactory.cs (1)
19public Endpoint Create(StaticAssetDescriptor resource, List<Action<EndpointBuilder>> conventions, List<Action<EndpointBuilder>> finallyConventions)
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1598var newEndpoint = Assert.Single(endpointDataSource.Endpoints);
MinimalSample (1)
Program.cs (1)
32var endpoint = invocationContext.HttpContext.GetEndpoint();
Mvc.RoutingWebSite (4)
StartupForDynamic.cs (4)
65public override ValueTask<IReadOnlyList<Endpoint>> FilterAsync(HttpContext httpContext, RouteValueDictionary values, IReadOnlyList<Endpoint> endpoints) 71return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>());
RoutingSandbox (5)
Framework\FrameworkEndpointDataSource.cs (5)
18private List<Endpoint> _endpoints; 29public override IReadOnlyList<Endpoint> Endpoints 42private List<Endpoint> BuildEndpoints() 44List<Endpoint> endpoints = new List<Endpoint>();
RoutingWebSite (1)
UseEndpointRoutingStartup.cs (1)
70var endpoint = httpContext.GetEndpoint();
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
73var endpoint = context.HttpContext.Features.Get<IEndpointFeature>()?.Endpoint;
StaticFilesAuth (2)
Startup.cs (2)
45if (context.Resource is HttpContext httpContext && httpContext.GetEndpoint() is Endpoint endpoint) 132var endpoint = new Endpoint(