3 instantiations of RoutePattern
Microsoft.AspNetCore.Routing (3)
Patterns\DefaultRoutePatternTransformer.cs (1)
188return new RoutePattern(
Patterns\RoutePatternFactory.cs (2)
533return new RoutePattern( 1098return new RoutePattern(rawText, defaults, parameterPolicies, requiredValues, parameters, pathSegments);
360 references to RoutePattern
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
151Routing.Patterns.RoutePattern routePattern = null;
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (1)
229private static (RoutePattern routePattern, CallHandlerDescriptorInfo descriptorInfo) ParseRoute(string pattern, string body, string responseBody, MethodDescriptor methodDescriptor)
Microsoft.AspNetCore.Mvc.ApiExplorer (4)
EndpointMetadataApiDescriptionProvider.cs (4)
173var pattern = routeEndpoint.RoutePattern; 201private static ParameterDescriptor CreateParameterDescriptor(ParameterInfo parameter, RoutePattern pattern) 213private ApiParameterRouteInfo? CreateParameterRouteInfo(RoutePattern pattern, ParameterInfo parameter, bool isOptional) 252var pattern = routeEndpoint.RoutePattern;
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1553var routePattern = RoutePatternFactory.Parse(pattern ?? "/");
Microsoft.AspNetCore.Mvc.Core (12)
Routing\ActionEndpointDataSourceBase.cs (1)
65RoutePattern? groupPrefix,
Routing\ActionEndpointFactory.cs (9)
48RoutePattern? groupPrefix = null) 93var updatedRoutePattern = _routePatternTransformer.SubstituteRequiredValues(route.Pattern, action.RouteValues); 130var attributeRoutePattern = RoutePatternFactory.Parse(action.AttributeRouteInfo.Template); 136var updatedRoutePattern = _routePatternTransformer.SubstituteRequiredValues(resolvedRoutePattern, resolvedRouteValues); 183RoutePattern? groupPrefix = null) 195requiredValues[key] = RoutePattern.RequiredValueAny; 209var pattern = _routePatternTransformer.SubstituteRequiredValues(route.Pattern, requiredValues); 276private static (RoutePattern resolvedRoutePattern, IDictionary<string, string?> resolvedRequiredValues) ResolveDefaultsAndRequiredValues(ActionDescriptor action, RoutePattern attributeRoutePattern)
Routing\ControllerActionEndpointDataSource.cs (1)
66RoutePattern? groupPrefix,
Routing\ConventionalRouteEntry.cs (1)
13public readonly RoutePattern Pattern;
Microsoft.AspNetCore.Mvc.Core.Test (10)
Routing\ActionEndpointDataSourceBaseTest.cs (2)
98var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern; 120var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern;
Routing\ControllerActionEndpointDataSourceTest.cs (1)
426var groupPattern = RoutePatternFactory.Parse("/group1");
Routing\RoutePatternWriterTests.cs (1)
25var routePattern = RoutePatternFactory.Parse(template);
Routing\UrlHelperTestBase.cs (6)
961requiredValues: new { controller = RoutePattern.RequiredValueAny, action = RoutePattern.RequiredValueAny }); 999requiredValues: new { controller = RoutePattern.RequiredValueAny, action = RoutePattern.RequiredValueAny }); 1040requiredValues: new { controller = RoutePattern.RequiredValueAny, action = RoutePattern.RequiredValueAny });
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageActionEndpointDataSource.cs (1)
45RoutePattern? groupPrefix,
Microsoft.AspNetCore.Mvc.RazorPages.Test (9)
Infrastructure\DefaultPageLoaderTest.cs (6)
115.Setup(t => t.SubstituteRequiredValues(It.IsAny<RoutePattern>(), It.IsAny<object>())) 116.Returns<RoutePattern, object>((p, v) => p); 232.Setup(t => t.SubstituteRequiredValues(It.IsAny<RoutePattern>(), It.IsAny<object>())) 233.Returns<RoutePattern, object>((p, v) => p); 294.Setup(t => t.SubstituteRequiredValues(It.IsAny<RoutePattern>(), It.IsAny<object>())) 295.Returns<RoutePattern, object>((p, v) => p);
Infrastructure\PageActionEndpointDataSourceTest.cs (1)
144var groupPattern = RoutePatternFactory.Parse("/group1");
src\Mvc\Mvc.Core\test\Routing\ActionEndpointDataSourceBaseTest.cs (2)
98var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern; 120var routePattern = Assert.IsType<RouteEndpoint>(e).RoutePattern;
Microsoft.AspNetCore.OpenApi (7)
Extensions\ApiDescriptionExtensions.cs (1)
51var routePattern = RoutePatternFactory.Parse(apiDescription.RelativePath);
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (1)
96var pattern = routeEndpointBuilder.RoutePattern;
Services\OpenApiGenerator.cs (5)
60RoutePattern pattern) 72private OpenApiOperation GetOperation(string httpMethod, MethodInfo methodInfo, EndpointMetadataCollection metadata, RoutePattern pattern) 255private OpenApiRequestBody? GetOpenApiRequestBody(MethodInfo methodInfo, EndpointMetadataCollection metadata, RoutePattern pattern, bool disableInferredBody) 360private List<OpenApiParameter> GetOpenApiParameters(MethodInfo methodInfo, RoutePattern pattern, bool disableInferredBody) 399private (bool isBodyOrForm, ParameterLocation? locatedIn, string? name) GetOpenApiParameterLocation(ParameterInfo parameter, RoutePattern pattern, bool disableInferredBody)
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiGeneratorTests.cs (1)
1009var routePattern = RoutePatternFactory.Parse(pattern ?? "/");
Microsoft.AspNetCore.Routing (143)
Builder\EndpointRouteBuilderExtensions.cs (5)
49public static RouteGroupBuilder MapGroup(this IEndpointRouteBuilder endpoints, RoutePattern prefix) 183RoutePattern pattern, 191RoutePattern pattern, 361RoutePattern pattern, 428RoutePattern pattern,
EndpointDataSource.cs (1)
54var fullRoutePattern = RoutePatternFactory.Combine(context.Prefix, routeEndpoint.RoutePattern);
Matching\DfaMatcherBuilder.cs (1)
980private static bool TryGetRequiredValue(RoutePattern routePattern, RoutePatternParameterPart parameterPart, out object value)
Patterns\DefaultRoutePatternTransformer.cs (7)
23public override RoutePattern SubstituteRequiredValues(RoutePattern original, object requiredValues) 30public override RoutePattern SubstituteRequiredValues(RoutePattern original, RouteValueDictionary requiredValues) 79else if (RoutePattern.IsRequiredValueAny(kvp.Value)) 167!RoutePattern.IsRequiredValueAny(kvp.Value) && 197private bool MatchesConstraints(RoutePattern pattern, RoutePatternParameterPart parameter, string key, RouteValueDictionary requiredValues)
Patterns\RoutePattern.cs (3)
13/// Use <see cref="RoutePatternFactory"/> to create <see cref="RoutePattern"/> 14/// instances. Instances of <see cref="RoutePattern"/> are immutable. 28/// <see cref="RequiredValueAny"/> is only use in routing is in <see cref="RoutePattern.RequiredValues"/>.
Patterns\RoutePatternException.cs (1)
11/// An exception that is thrown for error constructing a <see cref="RoutePattern"/>.
Patterns\RoutePatternFactory.cs (67)
24/// Contains factory methods for creating <see cref="RoutePattern"/> and related types. 41/// Creates a <see cref="RoutePattern"/> from its string representation. 44/// <returns>The <see cref="RoutePattern"/>.</returns> 45public static RoutePattern Parse([StringSyntax("Route")] string pattern) 53/// Creates a <see cref="RoutePattern"/> from its string representation along 68/// <returns>The <see cref="RoutePattern"/>.</returns> 70public static RoutePattern Parse([StringSyntax("Route")] string pattern, object? defaults, object? parameterPolicies) 74var original = RoutePatternParser.Parse(pattern); 79/// Creates a <see cref="RoutePattern"/> from its string representation along 94/// <returns>The <see cref="RoutePattern"/>.</returns> 95public static RoutePattern Parse([StringSyntax("Route")] string pattern, RouteValueDictionary? defaults, RouteValueDictionary? parameterPolicies) 99var original = RoutePatternParser.Parse(pattern); 104/// Creates a <see cref="RoutePattern"/> from its string representation along 120/// Route values that can be substituted for parameters in the route pattern. See remarks on <see cref="RoutePattern.RequiredValues"/>. 122/// <returns>The <see cref="RoutePattern"/>.</returns> 124public static RoutePattern Parse([StringSyntax("Route")] string pattern, object? defaults, object? parameterPolicies, object? requiredValues) 128var original = RoutePatternParser.Parse(pattern); 133/// Creates a <see cref="RoutePattern"/> from its string representation along 149/// Route values that can be substituted for parameters in the route pattern. See remarks on <see cref="RoutePattern.RequiredValues"/>. 151/// <returns>The <see cref="RoutePattern"/>.</returns> 152public static RoutePattern Parse([StringSyntax("Route")] string pattern, RouteValueDictionary? defaults, RouteValueDictionary? parameterPolicies, RouteValueDictionary? requiredValues) 156var original = RoutePatternParser.Parse(pattern); 161/// Creates a new instance of <see cref="RoutePattern"/> from a collection of segments. 164/// <returns>The <see cref="RoutePattern"/>.</returns> 165public static RoutePattern Pattern(IEnumerable<RoutePatternPathSegment> segments) 173/// Creates a new instance of <see cref="RoutePattern"/> from a collection of segments. 177/// <returns>The <see cref="RoutePattern"/>.</returns> 178public static RoutePattern Pattern(string? rawText, IEnumerable<RoutePatternPathSegment> segments) 187/// Creates a <see cref="RoutePattern"/> from a collection of segments along 202/// <returns>The <see cref="RoutePattern"/>.</returns> 204public static RoutePattern Pattern( 215/// Creates a <see cref="RoutePattern"/> from a collection of segments along 230/// <returns>The <see cref="RoutePattern"/>.</returns> 231public static RoutePattern Pattern( 242/// Creates a <see cref="RoutePattern"/> from a collection of segments along 258/// <returns>The <see cref="RoutePattern"/>.</returns> 260public static RoutePattern Pattern( 272/// Creates a <see cref="RoutePattern"/> from a collection of segments along 288/// <returns>The <see cref="RoutePattern"/>.</returns> 289public static RoutePattern Pattern( 301/// Creates a new instance of <see cref="RoutePattern"/> from a collection of segments. 304/// <returns>The <see cref="RoutePattern"/>.</returns> 305public static RoutePattern Pattern(params RoutePatternPathSegment[] segments) 313/// Creates a new instance of <see cref="RoutePattern"/> from a collection of segments. 317/// <returns>The <see cref="RoutePattern"/>.</returns> 318public static RoutePattern Pattern(string rawText, params RoutePatternPathSegment[] segments) 326/// Creates a <see cref="RoutePattern"/> from a collection of segments along 341/// <returns>The <see cref="RoutePattern"/>.</returns> 343public static RoutePattern Pattern( 354/// Creates a <see cref="RoutePattern"/> from a collection of segments along 369/// <returns>The <see cref="RoutePattern"/>.</returns> 370public static RoutePattern Pattern( 381/// Creates a <see cref="RoutePattern"/> from a collection of segments along 397/// <returns>The <see cref="RoutePattern"/>.</returns> 399public static RoutePattern Pattern( 411/// Creates a <see cref="RoutePattern"/> from a collection of segments along 427/// <returns>The <see cref="RoutePattern"/>.</returns> 428public static RoutePattern Pattern( 440private static RoutePattern PatternCore( 1026/// Creates a <see cref="RoutePattern"/> that combines the specified patterns. 1030/// <returns>The combined <see cref="RoutePattern"/>.</returns> 1033public static RoutePattern Combine(RoutePattern? left, RoutePattern right) 1094var defaults = CombineDictionaries(left.Defaults, right.Defaults, rawText, nameof(RoutePattern.Defaults)); 1095var requiredValues = CombineDictionaries(left.RequiredValues, right.RequiredValues, rawText, nameof(RoutePattern.RequiredValues)); 1096var parameterPolicies = CombineDictionaries(left.ParameterPolicies, right.ParameterPolicies, rawText, nameof(RoutePattern.ParameterPolicies));
Patterns\RoutePatternMatcher.cs (2)
24RoutePattern pattern, 61public RoutePattern RoutePattern { get; }
Patterns\RoutePatternParameterPolicyReference.cs (1)
9/// The parsed representation of a policy in a <see cref="RoutePattern"/> parameter. Instances
Patterns\RoutePatternParser.cs (1)
25public static RoutePattern Parse(string pattern)
Patterns\RoutePatternTransformer.cs (13)
9/// A singleton service that provides transformations on <see cref="RoutePattern"/>. 17/// <param name="original">The original <see cref="RoutePattern"/>.</param> 20/// A new <see cref="RoutePattern"/> if substitution succeeds, otherwise <c>null</c>. 26/// <see cref="SubstituteRequiredValues(RoutePattern, object)"/> can produce a derived route pattern 31/// when examining a required value. <see cref="SubstituteRequiredValues(RoutePattern, object)"/> will 37public abstract RoutePattern? SubstituteRequiredValues(RoutePattern original, object requiredValues); 43/// <param name="original">The original <see cref="RoutePattern"/>.</param> 46/// A new <see cref="RoutePattern"/> if substitution succeeds, otherwise <c>null</c>. 52/// <see cref="SubstituteRequiredValues(RoutePattern, object)"/> can produce a derived route pattern 57/// when examining a required value. <see cref="SubstituteRequiredValues(RoutePattern, object)"/> will 61public virtual RoutePattern? SubstituteRequiredValues(RoutePattern original, RouteValueDictionary requiredValues)
RouteEndpoint.cs (2)
26RoutePattern routePattern, 51public RoutePattern RoutePattern { get; }
RouteEndpointBuilder.cs (3)
22public RoutePattern RoutePattern { get; set; } 37RoutePattern routePattern, 63private static EndpointMetadataCollection CreateMetadataCollection(IList<object> metadata, RoutePattern routePattern)
RouteEndpointDataSource.cs (6)
28RoutePattern pattern, 54RoutePattern pattern, 124RouteEntry entry, RoutePattern? groupPrefix = null, IReadOnlyList<Action<EndpointBuilder>>? groupConventions = null, IReadOnlyList<Action<EndpointBuilder>>? groupFinallyConventions = null) 126var pattern = RoutePatternFactory.Combine(groupPrefix, entry.RoutePattern); 272private RequestDelegateFactoryOptions CreateRdfOptions(RouteEntry entry, RoutePattern pattern, RouteEndpointBuilder builder) 324public required RoutePattern RoutePattern { get; init; }
RouteGroupBuilder.cs (6)
15/// <see cref="EndpointRouteBuilderExtensions.MapGroup(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder, RoutePattern)"/> 21private readonly RoutePattern _partialPrefix; 27internal RouteGroupBuilder(IEndpointRouteBuilder outerEndpointRouteBuilder, RoutePattern partialPrefix) 58RoutePattern? prefix, 89RoutePattern? prefix, 94var fullPrefix = RoutePatternFactory.Combine(prefix, _routeGroupBuilder._partialPrefix);
RouteGroupContext.cs (3)
17/// not just the prefix supplied to the innermost call to <see cref="EndpointRouteBuilderExtensions.MapGroup(IEndpointRouteBuilder, RoutePattern)"/>. 22/// Gets all conventions added to ancestor <see cref="RouteGroupBuilder"/> instances returned from <see cref="EndpointRouteBuilderExtensions.MapGroup(IEndpointRouteBuilder, RoutePattern)"/> 29/// Gets all conventions added to ancestor <see cref="RouteGroupBuilder"/> instances returned from <see cref="EndpointRouteBuilderExtensions.MapGroup(IEndpointRouteBuilder, RoutePattern)"/>
Template\DefaultTemplateBinderFactory.cs (1)
34public override TemplateBinder Create(RoutePattern pattern)
Template\RoutePrecedence.cs (3)
58internal static decimal ComputeInbound(RoutePattern routePattern) 112internal static decimal ComputeOutbound(RoutePattern routePattern) 249internal static int ComputeInboundPrecedenceDigit(RoutePattern routePattern, RoutePatternPathSegment pathSegment)
Template\RouteTemplate.cs (5)
23/// <param name="other">A <see cref="RoutePattern"/> instance.</param> 24public RouteTemplate(RoutePattern other) 134/// <see cref="RoutePattern"/> 136/// <returns>A <see cref="RoutePattern"/>.</returns> 137public RoutePattern ToRoutePattern()
Template\TemplateBinder.cs (7)
28private readonly RoutePattern _pattern; 57/// <param name="pattern">The <see cref="RoutePattern"/> to bind values to.</param> 66RoutePattern pattern, 98RoutePattern pattern, 228!RoutePattern.IsRequiredValueAny(_pattern.RequiredValues[key])) 315(RoutePartsEqual(requiredValue, ambientValue) || RoutePattern.IsRequiredValueAny(requiredValue))) 720private static KeyValuePair<string, object?>[] AssignSlots(RoutePattern pattern, KeyValuePair<string, object?>[] filters)
Template\TemplateBinderFactory.cs (2)
25/// <param name="pattern">The <see cref="RoutePattern"/>.</param> 27public abstract TemplateBinder Create(RoutePattern pattern);
Template\TemplateMatcher.cs (1)
60var routePattern = Template.ToRoutePattern();
Template\TemplateParser.cs (1)
24var inner = RoutePatternFactory.Parse(routeTemplate);
Tree\LinkGenerationDecisionTree.cs (1)
45if (RoutePattern.IsRequiredValueAny(kvp.Value))
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (1)
51var withoutDefaults = RoutePatternFactory.Parse(endpoint.RoutePattern.RawText);
Microsoft.AspNetCore.Routing.Tests (164)
Builder\GroupTest.cs (3)
140ex = Assert.Throws<ArgumentNullException>(() => builder.MapGroup((RoutePattern)null!)); 160RoutePattern? outerPattern = null; 161RoutePattern? innerPattern = null;
CompositeEndpointDataSourceTest.cs (5)
43var prefix = RoutePatternFactory.Parse("/"); 288var prefix = RoutePatternFactory.Parse("/prefix"); 328var prefix = RoutePatternFactory.Parse("/prefix"); 380var prefix = RoutePatternFactory.Parse("/prefix"); 439var prefix = RoutePatternFactory.Parse("/prefix");
EndpointFactory.cs (2)
20var routePattern = RoutePatternFactory.Parse(template, defaults, policies, requiredValues); 26RoutePattern routePattern = null,
LinkGeneratorIntegrationTest.cs (5)
91requiredValues: new { controller = RoutePattern.RequiredValueAny, action = RoutePattern.RequiredValueAny, area = (string)null, page = (string)null, }), 121requiredValues: new { controller = RoutePattern.RequiredValueAny, action = RoutePattern.RequiredValueAny, area = "Admin", page = (string)null, }), 131requiredValues: new { controller = RoutePattern.RequiredValueAny, action = (string)null, area = (string)null, page = (string)null, }),
Matching\DfaMatcherBuilderTest.cs (3)
3517var routePattern = RoutePatternFactory.Parse(template, defaults, constraints); 3527public static RoutePattern CreateRoutePattern(RoutePattern routePattern, object requiredValues)
Matching\RouteMatcherBuilder.cs (1)
51var withoutDefaults = RoutePatternFactory.Parse(endpoint.RoutePattern.RawText);
Patterns\DefaultRoutePatternTransformerTest.cs (37)
29var original = RoutePatternFactory.Parse(template, defaults, policies); 34var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 51var original = RoutePatternFactory.Parse(template, defaults, policies); 56var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 70var original = RoutePatternFactory.Parse(template, defaults, policies); 72var requiredValues = new { controller = RoutePattern.RequiredValueAny, }; 75var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 85kvp => Assert.Equal(new KeyValuePair<string, object>("controller", RoutePattern.RequiredValueAny), kvp)); 96var original = RoutePatternFactory.Parse(template, defaults, policies); 101var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 112var defaults = new { area = RoutePattern.RequiredValueAny }; 115var original = RoutePatternFactory.Parse(template, defaults, policies); 120var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 134var original = RoutePatternFactory.Parse(template, defaults, policies); 139var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 156var original = RoutePatternFactory.Parse(template, defaults, policies); 161var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 183var original = RoutePatternFactory.Parse(template, defaults, policies); 188var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 218var original = RoutePatternFactory.Parse(template, defaults, policies); 223var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 240var original = RoutePatternFactory.Parse(template, defaults, policies); 245var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 259var original = RoutePatternFactory.Parse(template, defaults, policies); 264var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 281var original = RoutePatternFactory.Parse(template, defaults, policies); 286var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 300var original = RoutePatternFactory.Parse(template, defaults, policies); 305var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 322var original = RoutePatternFactory.Parse(template, defaults, policies); 327var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 344var original = RoutePatternFactory.Parse(template, defaults, policies); 349var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 366var original = RoutePatternFactory.Parse(template, defaults, policies, new { area = "Admin", controller = "Home", }); 371var actual = Transformer.SubstituteRequiredValues(original, requiredValues); 389var original = RoutePatternFactory.Parse(template, defaults, policies); 394var actual = Transformer.SubstituteRequiredValues(original, requiredValues);
Patterns\InlineRouteParameterParserTest.cs (1)
269var routePattern = RoutePatternFactory.Parse(@"some/url-{p1:int:test(3)=hello}/{p2=abc}/{p3?}");
Patterns\RoutePatternFactoryTest.cs (49)
20var original = RoutePatternFactory.Parse(template); 23var actual = RoutePatternFactory.Pattern( 49var original = RoutePatternFactory.Parse(template); 52var actual = RoutePatternFactory.Pattern( 73var original = RoutePatternFactory.Parse(template); 98var original = RoutePatternFactory.Parse(template); 101var actual = RoutePatternFactory.Pattern( 121var original = RoutePatternFactory.Parse(template); 144var original = RoutePatternFactory.Parse(template); 147var actual = RoutePatternFactory.Pattern( 189var original = RoutePatternFactory.Parse(template); 192var actual = RoutePatternFactory.Pattern( 225var original = RoutePatternFactory.Parse(template); 228var actual = RoutePatternFactory.Pattern( 256var original = RoutePatternFactory.Parse(template); 259var actual = RoutePatternFactory.Pattern( 302var original = RoutePatternFactory.Parse(template); 323var original = RoutePatternFactory.Parse(template); 326var actual = RoutePatternFactory.Pattern( 359var original = RoutePatternFactory.Parse(template); 362var actual = RoutePatternFactory.Pattern( 387var original = RoutePatternFactory.Parse(template); 419var actual = RoutePatternFactory.Pattern(segments); 448var actual = RoutePatternFactory.Pattern(rawText, segments); 478var actual = RoutePatternFactory.Pattern(defaults, parameterPolicies, segments); 518var actual = RoutePatternFactory.Pattern(rawText, defaults, parameterPolicies, segments); 548var action = RoutePatternFactory.Parse(template, defaults, policies, requiredValues); 568var action = RoutePatternFactory.Parse(template, defaults, policies, requiredValues); 588var action = RoutePatternFactory.Parse(template, defaults, policies, requiredValues); 610var action = RoutePatternFactory.Parse(template, defaults, policies, requiredValues); 732var left = RoutePatternFactory.Parse(leftTemplate); 733var right = RoutePatternFactory.Parse(rightTemplate); 735var combined = RoutePatternFactory.Combine(left, right); 754var left = RoutePatternFactory.Parse("/{id}"); 755var right = RoutePatternFactory.Parse("/{ID}"); 767var left = RoutePatternFactory.Parse("/a/{x=foo}"); 768var right = RoutePatternFactory.Parse("/b", defaults: new { X = "foo" }, parameterPolicies: null); 770var combined = RoutePatternFactory.Combine(left, right); 784var left = RoutePatternFactory.Parse("/a", defaults: new { x = "foo" }, parameterPolicies: null, requiredValues: new { x = "foo" }); 785var right = RoutePatternFactory.Parse("/b", defaults: new { X = "foo" }, parameterPolicies: null, requiredValues: new { X = "foo" }); 787var combined = RoutePatternFactory.Combine(left, right); 802var left = RoutePatternFactory.Parse("/a", defaults: null, parameterPolicies: policies); 803var right = RoutePatternFactory.Parse("/b", defaults: null, parameterPolicies: policies); 814var left = RoutePatternFactory.Parse("/a/{x=foo}"); 815var right = RoutePatternFactory.Parse("/b", defaults: new { X = "Foo" }, parameterPolicies: null); 827var left = RoutePatternFactory.Parse("/a", defaults: new { x = "foo" }, parameterPolicies: null, requiredValues: new { x = "foo" }); 828var right = RoutePatternFactory.Parse("/b", defaults: new { X = "foo" }, parameterPolicies: null, requiredValues: new { X = "Foo" }); 839var left = RoutePatternFactory.Parse("/a/{x:string}"); 840var right = RoutePatternFactory.Parse("/b", defaults: null, parameterPolicies: new { X = new RegexRouteConstraint("foo") });
Patterns\RoutePatternParserTest.cs (56)
18var expected = Pattern( 23var actual = RoutePatternParser.Parse(template); 26Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 35var expected = Pattern(template, Segment(ParameterPart("p"))); 38var actual = RoutePatternParser.Parse(template); 41Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 50var expected = Pattern(template, Segment(ParameterPart("p", null, RoutePatternParameterKind.Optional))); 53var actual = RoutePatternParser.Parse(template); 56Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 65var expected = Pattern( 72var actual = RoutePatternParser.Parse(template); 75Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 84var expected = Pattern( 91var actual = RoutePatternParser.Parse(template); 94Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 103var expected = Pattern( 110var actual = RoutePatternParser.Parse(template); 113Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 122var expected = Pattern( 129var actual = RoutePatternParser.Parse(template); 132Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 141var expected = Pattern( 149var actual = RoutePatternParser.Parse(template); 152Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 161var expected = Pattern( 169var actual = RoutePatternParser.Parse(template); 172Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 181var expected = Pattern( 189var actual = RoutePatternParser.Parse(template); 192Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 201var expected = Pattern( 209var actual = RoutePatternParser.Parse(template); 212Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 221var expected = Pattern( 231var actual = RoutePatternParser.Parse(template); 234Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 243var expected = Pattern( 253var actual = RoutePatternParser.Parse(template); 256Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 265var expected = Pattern( 275var actual = RoutePatternParser.Parse(template); 278Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 287var expected = Pattern( 297var actual = RoutePatternParser.Parse(template); 300Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 309var expected = Pattern( 317var actual = RoutePatternParser.Parse(template); 320Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 332var expected = Pattern( 342var actual = RoutePatternParser.Parse(template); 345Assert.Equal<RoutePattern>(expected, actual, new RoutePatternEqualityComparer()); 597var pattern = RoutePatternParser.Parse(routePattern); 639IEqualityComparer<RoutePattern>, 642public bool Equals(RoutePattern x, RoutePattern y) 748public int GetHashCode(RoutePattern obj)
Template\RoutePatternPrecedenceTests.cs (2)
20private static decimal ComputeRoutePattern(string template, Func<RoutePattern, decimal> func) 22var parsed = RoutePatternFactory.Parse(template);
RoutingSandbox (5)
Framework\FrameworkConfigurationBuilder.cs (1)
22public void AddPattern(RoutePattern pattern)
Framework\FrameworkEndpointDataSource.cs (4)
15public List<RoutePattern> Patterns { get; } 25Patterns = new List<RoutePattern>(); 51foreach (var pattern in Patterns) 53var resolvedPattern = _routePatternTransformer.SubstituteRequiredValues(pattern, requiredValues);