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