18 references to Optional
Microsoft.AspNetCore.Routing (6)
Patterns\RouteParameterParser.cs (1)
45
parameterKind = RoutePatternParameterKind.
Optional
;
Patterns\RoutePatternFactory.cs (3)
828
if (@default != null && parameterKind == RoutePatternParameterKind.
Optional
)
862
if (@default != null && parameterKind == RoutePatternParameterKind.
Optional
)
898
if (@default != null && parameterKind == RoutePatternParameterKind.
Optional
)
Patterns\RoutePatternParameterPart.cs (1)
71
public bool IsOptional => ParameterKind == RoutePatternParameterKind.
Optional
;
Template\TemplatePart.cs (1)
170
RoutePatternParameterKind.
Optional
:
Microsoft.AspNetCore.Routing.Tests (12)
DefaultParameterPolicyFactoryTest.cs (6)
22
() => factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.
Optional
), @"notpresent(\d+)"));
80
parameterKind: RoutePatternParameterKind.
Optional
,
119
parameterKind: RoutePatternParameterKind.
Optional
,
184
var parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.
Optional
), "int");
204
var parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.
Optional
), "customParameterPolicy");
393
var parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.
Optional
), "customParameterPolicy");
Patterns\RoutePatternParserTest.cs (6)
50
var expected = Pattern(template, Segment(ParameterPart("p", null, RoutePatternParameterKind.
Optional
)));
186
ParameterPart("p2", null, RoutePatternParameterKind.
Optional
)));
228
ParameterPart("p3", null, RoutePatternParameterKind.
Optional
)));
270
ParameterPart("p2", null, RoutePatternParameterKind.
Optional
)),
294
ParameterPart("p3", null, RoutePatternParameterKind.
Optional
)));
314
ParameterPart("p3", null, RoutePatternParameterKind.
Optional
)));