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