1 write to RoutePattern
Microsoft.AspNetCore.Routing (1)
RouteEndpoint.cs (1)
35RoutePattern = routePattern;
223 references to RoutePattern
IntegrationTestsWebsite (2)
Infrastructure\DynamicEndpointDataSource.cs (2)
43.SingleOrDefault(e => e.RoutePattern.RawText == routeEndpoint.RoutePattern.RawText);
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
125routingStateProvider.RouteData.Template = routeEndpoint.RoutePattern.RawText;
Microsoft.AspNetCore.Components.Endpoints.Tests (11)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
243Assert.Equal(frameworkEndpoint, ((RouteEndpoint)webJSEndpoint).RoutePattern.RawText);
HotReloadServiceTests.cs (9)
52Assert.Equal("/server", endpoint.RoutePattern.RawText); 71(ep) => Assert.Equal("/app/test", ((RouteEndpoint)ep).RoutePattern.RawText), 72(ep) => Assert.Equal("/server", ((RouteEndpoint)ep).RoutePattern.RawText)); 87Assert.Equal("/server", endpoint.RoutePattern.RawText); 109Assert.Equal("/server", endpoint.RoutePattern.RawText); 119Assert.Equal("/server", updatedEndpoint.RoutePattern.RawText); 135Assert.Equal("/server", endpoint.RoutePattern.RawText); 137Assert.Equal("/server", compositeEndpoint.RoutePattern.RawText); 184Assert.Equal("/server", endpoint.RoutePattern.RawText);
RazorComponentEndpointFactoryTest.cs (1)
38Assert.Equal("/", routeEndpoint.RoutePattern.RawText);
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
148var builder = new RouteEndpointBuilder(endpoint.RequestDelegate, routeEndpoint.RoutePattern, routeEndpoint.Order);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
WebAssemblyEndpointProvider.cs (1)
71var builder = new RouteEndpointBuilder(endpoint.RequestDelegate, routeEndpoint.RoutePattern, routeEndpoint.Order);
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
351endpointModel.RoutePattern = routeEndpoint.RoutePattern.RawText;
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Logging\HttpLoggingRedactionInterceptor.cs (2)
91if (endpoint?.RoutePattern.RawText != null) 93var httpRoute = endpoint.RoutePattern.RawText;
Logging\HttpUtilityExtensions.cs (1)
43return routeEndpoint.RoutePattern.RawText ?? string.Empty;
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (9)
JsonTranscodingServiceMethodProviderTests.cs (9)
31Assert.Equal("/v1/greeter/{name}", endpoint.RoutePattern.RawText); 32Assert.Single(endpoint.RoutePattern.Parameters); 33Assert.Equal("name", endpoint.RoutePattern.Parameters[0].Name); 45Assert.Equal("/v1/greeter/{name}", endpoint.RoutePattern.RawText); 63Assert.Equal("/v1/additional_bindings/{name}", getMethodModel.RoutePattern.RawText); 68Assert.Equal("/v1/additional_bindings/{name}", additionalMethodModel.RoutePattern.RawText); 83Assert.Equal("/v1/frames:startFrameImport", startFrameImport.RoutePattern.RawText); 87Assert.Equal("/v1/frames:getFrameImport", getFrameImport.RoutePattern.RawText); 159Assert.Equal("/v1/server_greeter/{name}", endpoint.RoutePattern.RawText);
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
EndpointMetadataApiDescriptionProvider.cs (3)
104RelativePath = routeEndpoint.RoutePattern.RawText?.TrimStart('/'), 173var pattern = routeEndpoint.RoutePattern; 252var pattern = routeEndpoint.RoutePattern;
Microsoft.AspNetCore.Mvc.Core.Test (68)
Routing\ActionEndpointDataSourceBaseTest.cs (5)
36Assert.Equal("Value", endpoint.RoutePattern.RequiredValues["Name"]); 37Assert.Equal("/Template!", endpoint.RoutePattern.RawText); 61(e) => Assert.Equal("/test", Assert.IsType<RouteEndpoint>(e).RoutePattern.RawText)); 98var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern; 120var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern;
Routing\ActionEndpointFactoryTest.cs (23)
149Assert.Equal("{controller}/{action}/{id?}", endpoint.RoutePattern.RawText); 150Assert.Equal("TestController", endpoint.RoutePattern.RequiredValues["controller"]); 151Assert.Equal("TestAction", endpoint.RoutePattern.RequiredValues["action"]); 152Assert.Equal("TestController", endpoint.RoutePattern.Defaults["controller"]); 153Assert.False(endpoint.RoutePattern.Defaults.ContainsKey("action")); 184Assert.Equal("{controller}/{action=TESTACTION}/{id?}", endpoint.RoutePattern.RawText); 185Assert.Equal("TESTACTION", endpoint.RoutePattern.Defaults["action"]); 187Assert.Equal("TestAction", endpoint.RoutePattern.RequiredValues["action"]); 232Assert.Equal("{controller}/{action}/{page}", endpoint.RoutePattern.RawText); 233Assert.Equal("TestController", endpoint.RoutePattern.RequiredValues["controller"]); 234Assert.Equal("TestAction", endpoint.RoutePattern.RequiredValues["action"]); 235Assert.False(endpoint.RoutePattern.RequiredValues.ContainsKey("page")); 250Assert.Equal("{controller}/{action}/{page}", endpoint.RoutePattern.RawText); 251Assert.Equal("TestController", endpoint.RoutePattern.RequiredValues["controller"]); 252Assert.Equal("TestAction", endpoint.RoutePattern.RequiredValues["action"]); 253Assert.False(endpoint.RoutePattern.RequiredValues.ContainsKey("page")); 347Assert.Equal("{controller}/{action}/{id?}", matcherEndpoint.RoutePattern.RawText); 348Assert.Equal("Index", matcherEndpoint.RoutePattern.RequiredValues["action"]); 349Assert.Equal("Home", matcherEndpoint.RoutePattern.RequiredValues["controller"]); 355Assert.Equal("named/{controller}/{action}/{id?}", matcherEndpoint.RoutePattern.RawText); 356Assert.Equal("Index", matcherEndpoint.RoutePattern.RequiredValues["action"]); 357Assert.Equal("Home", matcherEndpoint.RoutePattern.RequiredValues["controller"]); 415AssertIsSubset(new RouteValueDictionary(action.RouteValues), endpoint.RoutePattern.RequiredValues);
Routing\ControllerActionEndpointDataSourceTest.cs (39)
91endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 94Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 99Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 104endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 107Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 114Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 121Assert.Equal("/test", e.RoutePattern.RawText); 173endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 176Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 182Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 188endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 191Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 197Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 203Assert.Equal("/test", e.RoutePattern.RawText); 260endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 263Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 268Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 273endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 276Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 283Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 290Assert.Equal("/test", e.RoutePattern.RawText); 342endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 345Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 351Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 357endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 360Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 366Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 372Assert.Equal("/test", e.RoutePattern.RawText); 436endpoints.OfType<RouteEndpoint>().Where(e => !SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 439Assert.Equal("/group1/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 446Assert.Equal("/group1/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 453endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 456Assert.Equal("/group1/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 464Assert.Equal("/group1/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 471Assert.Equal("/group1/test", e.RoutePattern.RawText); 526endpoints.OfType<RouteEndpoint>().Where(e => SupportsLinkGeneration(e)).OrderBy(e => e.RoutePattern.RawText), 529Assert.Equal("/1/{controller}/{action}/{id?}", e.RoutePattern.RawText); 534Assert.Equal("/2/{controller}/{action}/{id?}", e.RoutePattern.RawText); 539Assert.Equal("/test", e.RoutePattern.RawText);
Routing\EndpointRoutingUrlHelperTest.cs (1)
36Assert.Equal("/" + endpoint2.RoutePattern.RawText, url);
Microsoft.AspNetCore.Mvc.RazorPages.Test (14)
Infrastructure\PageActionEndpointDataSourceTest.cs (9)
84endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText), 87Assert.Equal("/test", e.RoutePattern.RawText); 154endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText), 157Assert.Equal("/group1/test", e.RoutePattern.RawText); 164Assert.Equal("/group1/test2", e.RoutePattern.RawText); 204endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText), 207Assert.Equal("/test", e.RoutePattern.RawText); 252endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText), 255Assert.Equal("/test", e.RoutePattern.RawText);
src\Mvc\Mvc.Core\test\Routing\ActionEndpointDataSourceBaseTest.cs (5)
36Assert.Equal("Value", endpoint.RoutePattern.RequiredValues["Name"]); 37Assert.Equal("/Template!", endpoint.RoutePattern.RawText); 61(e) => Assert.Equal("/test", Assert.IsType<RouteEndpoint>(e).RoutePattern.RawText)); 98var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern; 120var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern;
Microsoft.AspNetCore.OpenApi.Tests (2)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (1)
45Assert.Equal(expectedPath, generatedEndpoint.RoutePattern.RawText);
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (1)
228e => ((RouteEndpoint)e).RoutePattern.RawText,
Microsoft.AspNetCore.Routing (52)
DefaultLinkGenerator.cs (6)
273return _binderFactory.Create(endpoint.RoutePattern); 355=> TemplateSucceeded(logger, endpoint.RoutePattern.RawText, endpoint.DisplayName, path.Value, query.Value); 367TemplateFailedRequiredValues(logger, endpoint.RoutePattern.RawText, endpoint.DisplayName, FormatRouteValues(ambientValues), FormatRouteValues(values), FormatRouteValues(endpoint.RoutePattern.Defaults)); 384TemplateFailedConstraint(logger, endpoint.RoutePattern.RawText, endpoint.DisplayName, constraint, parameterName, FormatRouteValues(values)); 400TemplateFailedExpansion(logger, endpoint.RoutePattern.RawText, endpoint.DisplayName, FormatRouteValues(values));
DefaultLinkParser.cs (4)
91var policies = endpoint.RoutePattern.ParameterPolicies; 95var parameter = endpoint.RoutePattern.GetParameter(kvp.Key); 111var matcher = new RoutePatternMatcher(endpoint.RoutePattern, new RouteValueDictionary(endpoint.RoutePattern.Defaults));
EndpointDataSource.cs (4)
54var fullRoutePattern = RoutePatternFactory.Combine(context.Prefix, routeEndpoint.RoutePattern); 102var template = routeEndpoint.RoutePattern.RawText; 106FormatValues(sb, routeEndpoint.RoutePattern.Defaults); 111var routeValues = routeEndpoint.RoutePattern.RequiredValues;
Matching\DataSourceDependentMatcher.cs (1)
58seenEndpointNames.Add(endpointName, endpoint.DisplayName ?? endpoint.RoutePattern.RawText);
Matching\DfaMatcher.cs (1)
430return (endpoint as RouteEndpoint)?.RoutePattern?.RawText ?? "(none)";
Matching\DfaMatcherBuilder.cs (22)
84maxDepth = Math.Max(maxDepth, endpoint.RoutePattern.PathSegments.Count); 300else if (segment.IsSimple && parameterPart != null && TryGetRequiredValue(endpoint.RoutePattern, parameterPart, out var requiredValue)) 325if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 400if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(partParameter.Name, out var parameterPolicyReferences)) 475if (endpoint.RoutePattern.ParameterPolicies.TryGetValue(parameterPart.Name, out var parameterPolicyReferences)) 513if (depth < endpoint.RoutePattern.PathSegments.Count) 515return endpoint.RoutePattern.PathSegments[depth]; 518if (endpoint.RoutePattern.PathSegments.Count == 0) 523var lastSegment = endpoint.RoutePattern.PathSegments[endpoint.RoutePattern.PathSegments.Count - 1]; 541return RoutePrecedence.ComputeInboundPrecedenceDigit(endpoint.RoutePattern, segment); 747foreach (var kvp in routeEndpoint.RoutePattern.Defaults) 753for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 755var segment = routeEndpoint.RoutePattern.PathSegments[i]; 774if (TryGetRequiredValue(routeEndpoint.RoutePattern, parameterPart, out var requiredValue)) 785if (TryGetRequiredValue(routeEndpoint.RoutePattern, parameterPart, out _)) 800for (var i = 0; i < routeEndpoint.RoutePattern.PathSegments.Count; i++) 802var segment = routeEndpoint.RoutePattern.PathSegments[i]; 811foreach (var kvp in routeEndpoint.RoutePattern.ParameterPolicies) 813var parameter = routeEndpoint.RoutePattern.GetParameter(kvp.Key); // may be null, that's ok 850for (var i = depth; i < endpoint.RoutePattern.PathSegments.Count; i++) 852var segment = endpoint.RoutePattern.PathSegments[i];
Matching\EndpointComparer.cs (4)
62return string.Compare(routeEndpointX.RoutePattern.RawText, routeEndpointY.RoutePattern.RawText, StringComparison.OrdinalIgnoreCase); 146return routeEndpointX.RoutePattern.InboundPrecedence 147.CompareTo(routeEndpointY.RoutePattern.InboundPrecedence);
RouteEndpoint.cs (2)
18/// <param name="routePattern">The <see cref="RoutePattern"/> to use in URL matching.</param> 49/// Gets the <see cref="RoutePattern"/> associated with the endpoint.
RouteGroupContext.cs (2)
15/// Gets the <see cref="RouteEndpoint.RoutePattern"/> which should prefix the <see cref="RouteEndpoint.RoutePattern"/> of all <see cref="RouteEndpoint"/> instances
RouteValuesAddressScheme.cs (6)
101if (metadata == null && routeEndpoint.RoutePattern.RequiredValues.Count == 0) 113routeEndpoint.RoutePattern.RequiredValues, 118if (routeEndpoint.RoutePattern.RequiredValues.Count > 0) 155Precedence = RoutePrecedence.ComputeOutbound(endpoint.RoutePattern), 157RouteTemplate = new RouteTemplate(endpoint.RoutePattern), 161entry.Defaults = new RouteValueDictionary(endpoint.RoutePattern.Defaults);
Microsoft.AspNetCore.Routing.Microbenchmarks (18)
EndpointRoutingBenchmarkBase.cs (3)
140endpoint.RoutePattern.RawText, 141defaults: endpoint.RoutePattern.Defaults, 143requiredLinkValues: new RouteValueDictionary(endpoint.RoutePattern.RequiredValues),
LinkGeneration\LinkGenerationGithubBenchmark.cs (1)
40_lookUpValues = new RouteValueDictionary(endpointToTest.RoutePattern.Defaults);
Matching\TrivialMatcher.cs (2)
28if (string.Equals(_endpoint.RoutePattern.RawText, path, StringComparison.OrdinalIgnoreCase)) 40if (string.Equals(_endpoint.RoutePattern.RawText, path, StringComparison.OrdinalIgnoreCase))
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcherBuilder.cs (1)
24var pathSegments = endpoint.RoutePattern.PathSegments
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (5)
35.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText)) 51var withoutDefaults = RoutePatternFactory.Parse(endpoint.RoutePattern.RawText); 52var defaults = new RouteValueDictionary(endpoint.RoutePattern.Defaults); 64endpoint.RoutePattern.RawText,
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (6)
42.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText)) 56var defaults = new RouteValueDictionary(endpoint.RoutePattern.Defaults); 57for (var i = 0; i < endpoint.RoutePattern.Parameters.Count; i++) 59var parameter = endpoint.RoutePattern.Parameters[i]; 68new RouteTemplate(endpoint.RoutePattern),
Microsoft.AspNetCore.Routing.Tests (32)
Builder\GroupTest.cs (7)
43Assert.Equal("/{id}", routeEndpoint.RoutePattern.RawText); 75Assert.Equal("/{org}/{id}", routeEndpoint.RoutePattern.RawText); 109Assert.Equal("/{org}/{id}/", routeEndpoint.RoutePattern.RawText); 253Assert.Equal("/bar", routeEndpoint.RoutePattern.RawText); 349Assert.Equal("/group/foo", routeEndpoint.RoutePattern.RawText); 355Assert.Equal("/group/bar", routeEndpoint.RoutePattern.RawText); 383Assert.Equal("/group/foo", prefixedEndpoint.RoutePattern.RawText);
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (2)
893Assert.Equal(expectedPattern, routeEndpoint.RoutePattern.RawText); 948.ToDictionary(e => ((RouteEndpoint)e).RoutePattern.RawText!);
CompositeEndpointDataSourceTest.cs (7)
310Assert.Equal("/prefix/a", resolvedEndpoint.RoutePattern.RawText); 359Assert.Equal("/prefix/a", endpoint.RoutePattern.RawText); 366Assert.Equal("/prefix/b", endpoint.RoutePattern.RawText); 414Assert.Equal("/prefix/a", endpoint.RoutePattern.RawText); 421Assert.Equal("/prefix/b", endpoint.RoutePattern.RawText); 480Assert.Equal("/prefix/a", endpoint.RoutePattern.RawText); 487Assert.Equal("/prefix/b", endpoint.RoutePattern.RawText);
Matching\BarebonesMatcherBuilder.cs (1)
24var pathSegments = endpoint.RoutePattern.PathSegments
Matching\DfaMatcherTest.cs (2)
457Assert.Equal(endpoints.ToArray(), set.candidates.Select(e => e.Endpoint).OrderBy(e => ((RouteEndpoint)e).RoutePattern.RawText).ToArray()); 562Assert.Equal(endpoints.ToArray(), set.candidates.Select(e => e.Endpoint).OrderBy(e => ((RouteEndpoint)e).RoutePattern.RawText).ToArray());
Matching\RouteMatcherBuilder.cs (5)
35.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText)) 51var withoutDefaults = RoutePatternFactory.Parse(endpoint.RoutePattern.RawText); 52var defaults = new RouteValueDictionary(endpoint.RoutePattern.Defaults); 64endpoint.RoutePattern.RawText,
Matching\TreeRouterMatcherBuilder.cs (6)
42.GroupBy(e => (e.Order, e.RoutePattern.InboundPrecedence, e.RoutePattern.RawText)) 56var defaults = new RouteValueDictionary(endpoint.RoutePattern.Defaults); 57for (var i = 0; i < endpoint.RoutePattern.Parameters.Count; i++) 59var parameter = endpoint.RoutePattern.Parameters[i]; 68new RouteTemplate(endpoint.RoutePattern),
RouteEndpointBuilderTest.cs (2)
44Assert.Equal("/", endpoint.RoutePattern.RawText); 63Assert.Equal("/", endpoint.RoutePattern.RawText);
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1600Assert.Equal("/new", newRouteEndpoint.RoutePattern.RawText);
RoutingSandbox (2)
UseEndpointRoutingStartup.cs (2)
39foreach (var endpoint in dataSource.Endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText, StringComparer.OrdinalIgnoreCase)) 41sb.AppendLine(FormattableString.Invariant($"- {endpoint.RoutePattern.RawText}"));
RoutingWebSite (2)
UseEndpointRoutingStartup.cs (2)
45foreach (var endpoint in dataSource.Endpoints.OfType<RouteEndpoint>().OrderBy(e => e.RoutePattern.RawText, StringComparer.OrdinalIgnoreCase)) 47sb.AppendLine(FormattableString.Invariant($"- {endpoint.RoutePattern.RawText}"));