4 instantiations of TemplatePart
Microsoft.AspNetCore.Routing (3)
Template\TemplatePart.cs (2)
65return new TemplatePart() 90return new TemplatePart()
Template\TemplateSegment.cs (1)
36Parts.Add(new TemplatePart(other.Parts[i]));
Microsoft.AspNetCore.Routing.Tests (1)
Template\TemplateSegmentTest.cs (1)
32templateSegment.Parts[1] = new TemplatePart(RoutePatternFactory.ParameterPart("D"));
169 references to TemplatePart
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
ApiParameterContext.cs (2)
15IReadOnlyList<TemplatePart> routeParameters) 30public IReadOnlyList<TemplatePart> RouteParameters { get; }
DefaultApiDescriptionProvider.cs (4)
109var templateParameters = parsedTemplate?.Parameters?.ToList() ?? new List<TemplatePart>(); 241foreach (var routeParameter in context.RouteParameters) 344private ApiParameterRouteInfo CreateRouteInfo(TemplatePart routeParameter) 397foreach (var part in segment.Parts)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2214var context = new ApiParameterContext(new EmptyModelMetadataProvider(), new ControllerActionDescriptor(), new TemplatePart[0]);
Microsoft.AspNetCore.Mvc.Core (1)
Routing\AttributeRoute.cs (1)
209foreach (var parameter in routeInfo.RouteTemplate.Parameters)
Microsoft.AspNetCore.Routing (37)
InlineRouteParameterParser.cs (5)
14/// Parses a string representing the provided <paramref name="routeParameter"/> into a <see cref="TemplatePart"/>. 17/// <returns>A <see cref="TemplatePart"/> instance.</returns> 18public static TemplatePart ParseRouteParameter(string routeParameter) 24return TemplatePart.CreateParameter( 88return TemplatePart.CreateParameter(parameterName,
RouteBase.cs (2)
219foreach (var parameter in parsedTemplate.Parameters) 246foreach (var parameter in parsedTemplate.Parameters)
Template\RoutePrecedence.cs (2)
156var part = segment.Parts[0]; 223var part = segment.Parts[0];
Template\RouteTemplate.cs (8)
38Parameters = new List<TemplatePart>(); 44var part = segment.Parts[j]; 67Parameters = new List<TemplatePart>(); 73var part = segment.Parts[j]; 88/// Gets the list of <see cref="TemplatePart"/> that represent that parameters defined in the route template. 90public IList<TemplatePart> Parameters { get; } 118public TemplatePart? GetParameter(string name) 122var parameter = Parameters[i];
Template\TemplateMatcher.cs (1)
47var part = segment.Parts[0];
Template\TemplatePart.cs (9)
18/// Constructs a new <see cref="TemplatePart"/> instance. 25/// Constructs a new <see cref="TemplatePart"/> instance given a <paramref name="other"/>. 59/// Create a <see cref="TemplatePart"/> representing a literal route part. 62/// <returns>A <see cref="TemplatePart"/> instance.</returns> 63public static TemplatePart CreateLiteral(string text) 73/// Creates a <see cref="TemplatePart"/> representing a parameter part. 80/// <returns>A <see cref="TemplatePart"/> instance.</returns> 81public static TemplatePart CreateParameter( 152/// Creates a <see cref="RoutePatternPart"/> for the route part designated by the <see cref="TemplatePart"/>.
Template\TemplateSegment.cs (3)
21Parts = new List<TemplatePart>(); 33Parts = new List<TemplatePart>(partCount); 48public List<TemplatePart> Parts { get; }
Tree\TreeRouteBuilder.cs (4)
115foreach (var parameter in routeTemplate.Parameters) 148foreach (var parameter in entry.RouteTemplate.Parameters) 201foreach (var parameter in routeTemplate.Parameters) 220foreach (var parameter in entry.RouteTemplate.Parameters)
Tree\TreeRouter.cs (1)
301var parameter = entry.RouteTemplate.GetParameter(kvp.Key);
Tree\UrlMatchingTree.cs (2)
99var part = segment.Parts[0]; 260var part = segments[i].Parts[0];
Microsoft.AspNetCore.Routing.Tests (122)
InlineRouteParameterParserTests.cs (69)
19var templatePart = ParseParameter(parameterName); 31var templatePart = ParseParameter("param="); 43var templatePart = ParseParameter("param:"); 56var templatePart = ParseParameter("param:="); 69var templatePart = ParseParameter("param=:"); 81var templatePart = ParseParameter("param:int=111111"); 95var templatePart = ParseParameter(@"param:test(\d+)=111111"); 109var templatePart = ParseParameter(@"param:int?"); 123var templatePart = ParseParameter(@"param:int=12?"); 138var templatePart = ParseParameter(@"param:int=12??"); 153var templatePart = ParseParameter(@"param:test(\d+)?"); 167var templatePart = ParseParameter(@"param:test(\d+)=abc?"); 183var templatePart = ParseParameter(@"param:test(d+):test(w+)"); 197var templatePart = ParseParameter(@"param::test(d+)::test(w+)"); 213var templatePart = ParseParameter(@"param:test(\d+):test(\w:+)"); 227var templatePart = ParseParameter(@"param:test(\d+):test(\w+)=qwer"); 243var templatePart = ParseParameter(@"param:test(\d+)::test(\w+)==qwer"); 263var templatePart = ParseParameter($"comparison-operator:length(6)={defaultValue}"); 282var param1 = parameters[0]; 292var param2 = parameters[1]; 297var param3 = parameters[2]; 306var templatePart = ParseParameter("world"); 316var templatePart = ParseParameter("param=world"); 327var templatePart = ParseParameter(@"param:test(\})"); 340var templatePart = ParseParameter(@"param:test(\})=wer"); 355var templatePart = ParseParameter(@"param:test(\))"); 368var templatePart = ParseParameter(@"param:test(\))=fsd"); 383var templatePart = ParseParameter(@"param:test(:)"); 396var templatePart = ParseParameter(@"param:test(:)=mnf"); 411var templatePart = ParseParameter(@"param:test(a:b:c)"); 424var templatePart = ParseParameter(@":param:test=12"); 439var templatePart = ParseParameter(@":param::test=12"); 455var templatePart = ParseParameter(@":param:test:"); 469var templatePart = ParseParameter(@"param:test(\w,\w)"); 482var templatePart = ParseParameter(@"par,am:test(\w)"); 495var templatePart = ParseParameter(@"param:test(\w,\w)=jsd"); 510var templatePart = ParseParameter(@"param:int=?"); 526var templatePart = ParseParameter(@"param:test(=)"); 540var templatePart = ParseParameter(@"param=test=bar"); 551var templatePart = ParseParameter(@"param:test(a==b)"); 565var templatePart = ParseParameter(@"param:test(a==b)=dvds"); 579var templatePart = ParseParameter(@"par==am:test=dvds"); 590var templatePart = ParseParameter(@"param:test==dvds"); 601var templatePart = ParseParameter(@"par=am:test(asd)"); 612var templatePart = ParseParameter(@"par=test(am):est=asd"); 623var templatePart = ParseParameter(@"param:test(=)=sds"); 637var templatePart = ParseParameter(@"param:test(\{)"); 650var templatePart = ParseParameter(@"par{am:test(\sd)"); 663var templatePart = ParseParameter(@"param:test(\{)=xvc"); 678var templatePart = ParseParameter(@"par(am:test(\()"); 691var templatePart = ParseParameter(@"param:test(\()"); 704var templatePart = ParseParameter(@"param:test(#$%"); 717var templatePart = ParseParameter(@"param:test(#:test1"); 731var templatePart = ParseParameter(@"param:test(abc:somevalue):name(test1:differentname=default-value"); 747var templatePart = ParseParameter(@"param:test(constraintvalue=test1"); 761var templatePart = ParseParameter(@"param:test(\()=djk"); 776var templatePart = ParseParameter(@"param:test(\?)"); 791var templatePart = ParseParameter(@"param:test(\?)?"); 806var templatePart = ParseParameter(@"param:test(\?)=sdf"); 821var templatePart = ParseParameter(@"param:test(\?)=sdf?"); 836var templatePart = ParseParameter(@"par?am:test(\?)"); 851var templatePart = ParseParameter(@"param:test(#):$)"); 867var templatePart = ParseParameter(@"param:test(#:)$)"); 882var templatePart = ParseParameter(@"foo:regex(\\(\\(\\(\\()"); 897var templatePart = ParseParameter(@"p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)"); // ssn 912var templatePart = ParseParameter(@"p1:regex(^\d{{3}}-\d{{3}}-\d{{4}}$)=123-456-7890"); // ssn 936var templatePart = ParseParameter(parameter); 944private TemplatePart ParseParameter(string routeParameter) 947var templatePart = InlineRouteParameterParser.ParseRouteParameter(routeParameter);
Patterns\RoutePatternFactoryTest.cs (4)
631var templatePart = TemplatePart.CreateParameter("t", false, false, null, constraints); 658var templatePart = TemplatePart.CreateParameter("t", false, false, null, constraints);
Template\TemplateParserTests.cs (49)
18expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool")); 36TemplatePart.CreateParameter("p", false, false, defaultValue: null, inlineConstraints: null)); 55TemplatePart.CreateParameter("p", false, true, defaultValue: null, inlineConstraints: null)); 73expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool")); 75expected.Segments[1].Parts.Add(TemplatePart.CreateLiteral("awesome")); 77expected.Segments[2].Parts.Add(TemplatePart.CreateLiteral("super")); 95expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 103expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p2", 111expected.Segments[2].Parts.Add(TemplatePart.CreateParameter("p3", 133expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 134expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 156expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 162expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 179expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 185expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 186expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 208expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 209expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 215expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("-awesome")); 232expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 237expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 238expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 262expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 267expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 268expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 292expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 297expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 298expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 304expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 305expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p3", 330expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 335expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 336expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 342expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 343expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p3", 368expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 373expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 374expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 384expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p3", 405expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 412expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p2", 417expected.Segments[1].Parts.Add(TemplatePart.CreateLiteral(".")); 418expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p3", 442expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 449expected.Segments[1].Parts.Add(TemplatePart.CreateLiteral(".")); 450expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p3", 478TemplatePart.CreateParameter("p1", 866private bool Equals(TemplatePart x, TemplatePart y)
Swaggatherer (2)
SwaggathererApplication.cs (2)
245var part = template.Segments[i].Parts[0]; 254private static string GenerateParameterValue(TemplatePart part)