2 writes to Parts
Microsoft.AspNetCore.Routing (2)
Template\TemplateSegment.cs (2)
21Parts = new List<TemplatePart>(); 33Parts = new List<TemplatePart>(partCount);
103 references to Parts
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
DefaultApiDescriptionProvider.cs (1)
397foreach (var part in segment.Parts)
Microsoft.AspNetCore.Routing (16)
Template\RoutePrecedence.cs (4)
151if (segment.Parts.Count > 1) 156var part = segment.Parts[0]; 217if (segment.Parts.Count > 1) 223var part = segment.Parts[0];
Template\RouteTemplate.cs (4)
42for (var j = 0; j < segment.Parts.Count; j++) 44var part = segment.Parts[j]; 71for (var j = 0; j < segment.Parts.Count; j++) 73var part = segment.Parts[j];
Template\TemplateMatcher.cs (1)
47var part = segment.Parts[0];
Template\TemplateSegment.cs (4)
36Parts.Add(new TemplatePart(other.Parts[i])); 43public bool IsSimple => Parts.Count == 1; 52return string.Join(string.Empty, Parts.Select(p => p.DebuggerToString())); 61var parts = Parts.Select(p => p.ToRoutePatternPart());
Tree\UrlMatchingTree.cs (3)
98Debug.Assert(segment.Parts.Count == 1); 99var part = segment.Parts[0]; 260var part = segments[i].Parts[0];
Microsoft.AspNetCore.Routing.Tests (83)
Template\TemplateParserTests.cs (81)
18expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool")); 35expected.Segments[0].Parts.Add( 37expected.Parameters.Add(expected.Segments[0].Parts[0]); 54expected.Segments[0].Parts.Add( 56expected.Parameters.Add(expected.Segments[0].Parts[0]); 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", 100expected.Parameters.Add(expected.Segments[0].Parts[0]); 103expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p2", 108expected.Parameters.Add(expected.Segments[1].Parts[0]); 111expected.Segments[2].Parts.Add(TemplatePart.CreateParameter("p3", 116expected.Parameters.Add(expected.Segments[2].Parts[0]); 133expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 134expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 139expected.Parameters.Add(expected.Segments[0].Parts[1]); 156expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 161expected.Parameters.Add(expected.Segments[0].Parts[0]); 162expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 179expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 184expected.Parameters.Add(expected.Segments[0].Parts[0]); 185expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 186expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 191expected.Parameters.Add(expected.Segments[0].Parts[2]); 208expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral("cool-")); 209expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 214expected.Parameters.Add(expected.Segments[0].Parts[1]); 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", 244expected.Parameters.Add(expected.Segments[0].Parts[0]); 245expected.Parameters.Add(expected.Segments[0].Parts[2]); 262expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 267expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 268expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 274expected.Parameters.Add(expected.Segments[0].Parts[0]); 275expected.Parameters.Add(expected.Segments[0].Parts[2]); 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", 311expected.Parameters.Add(expected.Segments[0].Parts[0]); 312expected.Parameters.Add(expected.Segments[0].Parts[2]); 313expected.Parameters.Add(expected.Segments[0].Parts[4]); 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", 349expected.Parameters.Add(expected.Segments[0].Parts[0]); 350expected.Parameters.Add(expected.Segments[0].Parts[2]); 351expected.Parameters.Add(expected.Segments[0].Parts[4]); 368expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p1", 373expected.Segments[0].Parts.Add(TemplatePart.CreateLiteral(".")); 374expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 380expected.Parameters.Add(expected.Segments[0].Parts[0]); 381expected.Parameters.Add(expected.Segments[0].Parts[2]); 384expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p3", 389expected.Parameters.Add(expected.Segments[1].Parts[0]); 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", 423expected.Parameters.Add(expected.Segments[0].Parts[0]); 424expected.Parameters.Add(expected.Segments[1].Parts[0]); 425expected.Parameters.Add(expected.Segments[1].Parts[2]); 442expected.Segments[0].Parts.Add(TemplatePart.CreateParameter("p2", 449expected.Segments[1].Parts.Add(TemplatePart.CreateLiteral(".")); 450expected.Segments[1].Parts.Add(TemplatePart.CreateParameter("p3", 455expected.Parameters.Add(expected.Segments[0].Parts[0]); 456expected.Parameters.Add(expected.Segments[1].Parts[1]); 477expected.Segments[0].Parts.Add( 483expected.Parameters.Add(expected.Segments[0].Parts[0]); 835if (x.Segments[i].Parts.Count != y.Segments[i].Parts.Count) 840for (int j = 0; j < x.Segments[i].Parts.Count; j++) 842if (!Equals(x.Segments[i].Parts[j], y.Segments[i].Parts[j]))
Template\TemplateSegmentTest.cs (2)
32templateSegment.Parts[1] = new TemplatePart(RoutePatternFactory.ParameterPart("D")); 33templateSegment.Parts.RemoveAt(0);
Swaggatherer (3)
SwaggathererApplication.cs (3)
194entry.Template.Segments[k].Parts[0].Text, 195other.Template.Segments[k].Parts[0].Text, 245var part = template.Segments[i].Parts[0];