1 write to RoutePattern
Microsoft.AspNetCore.Routing (1)
223 references to RoutePattern
IntegrationTestsWebsite (2)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (11)
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);
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Diagnostics (1)
Microsoft.AspNetCore.Diagnostics.Middleware (3)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (9)
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
Microsoft.AspNetCore.Mvc.Core.Test (68)
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);
Microsoft.AspNetCore.Mvc.RazorPages.Test (14)
Microsoft.AspNetCore.OpenApi.Tests (2)
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));
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];
Microsoft.AspNetCore.Routing.Microbenchmarks (18)
Microsoft.AspNetCore.Routing.Tests (32)
Microsoft.AspNetCore.Tests (1)
RoutingSandbox (2)
RoutingWebSite (2)