1 write to Parts
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternPathSegment.cs (1)
28
Parts
= parts;
76 references to Parts
Microsoft.AspNetCore.Mvc.Core (2)
Routing\RoutePatternWriter.cs (2)
26
for (var i = 0; i < segment.
Parts
.Count; i++)
28
WriteString(sb, segment.
Parts
[i]);
Microsoft.AspNetCore.OpenApi (1)
Extensions\ApiDescriptionExtensions.cs (1)
56
foreach (var part in segment.
Parts
)
Microsoft.AspNetCore.Routing (48)
Matching\DfaMatcherBuilder.cs (7)
260
var part = segment.
Parts
[0];
383
for (var i = 0; i < segment.
Parts
.Count; i++)
385
var segmentPart = segment.
Parts
[i];
396
Debug.Assert(i == segment.
Parts
.Count - 1 && partParameter.IsOptional);
524
if (lastSegment.IsSimple && lastSegment.
Parts
[0] is RoutePatternParameterPart parameterPart && parameterPart.IsCatchAll)
761
var parameterPart = segment.
Parts
[0] as RoutePatternParameterPart;
859
var parameterPart = segment.
Parts
[0] as RoutePatternParameterPart;
Patterns\DefaultRoutePatternTransformer.cs (3)
223
for (var j = 0; j < segment.
Parts
.Count; j++)
225
if (object.ReferenceEquals(parameter, segment.
Parts
[j]))
230
var updatedParts = new List<RoutePatternPart>(segment.
Parts
);
Patterns\RoutePatternFactory.cs (5)
476
for (var j = 0; j < segment.
Parts
.Count; j++)
478
if (segment.
Parts
[j] is RoutePatternParameterPart parameter)
546
for (var i = 0; i < segment.
Parts
.Count; i++)
548
var part = segment.
Parts
[i];
555
updatedParts = segment.
Parts
.ToArray();
Patterns\RoutePatternMatcher.cs (21)
44
var part = segment.
Parts
[0];
93
else if (pathSegment.IsSimple && pathSegment.
Parts
[0] is RoutePatternParameterPart parameter && parameter.IsCatchAll)
120
var part = pathSegment.
Parts
[0];
171
var part = pathSegment.
Parts
[0];
204
if (pathSegment.IsSimple && !pathSegment.
Parts
[0].IsParameter)
207
if (pathSegment.
Parts
[0].IsLiteral)
209
var part = (RoutePatternLiteralPart)pathSegment.
Parts
[0];
218
var part = (RoutePatternSeparatorPart)pathSegment.
Parts
[0];
226
else if (pathSegment.IsSimple && pathSegment.
Parts
[0].IsParameter)
229
var part = (RoutePatternParameterPart)pathSegment.
Parts
[0];
249
if (pathSegment.IsSimple && pathSegment.
Parts
[0] is RoutePatternParameterPart parameter && parameter.IsCatchAll)
266
else if (pathSegment.IsSimple && pathSegment.
Parts
[0].IsParameter)
270
parameter = (RoutePatternParameterPart)pathSegment.
Parts
[0];
291
var indexOfLastSegment = routeSegment.
Parts
.Count - 1;
302
if (routeSegment.
Parts
[indexOfLastSegment] is RoutePatternParameterPart parameter && parameter.IsOptional &&
303
routeSegment.
Parts
[indexOfLastSegment - 1].IsSeparator)
311
var separator = (RoutePatternSeparatorPart)routeSegment.
Parts
[indexOfLastSegment - 1];
339
Debug.Assert(routeSegment.
Parts
.Count > 1);
353
var part = routeSegment.
Parts
[indexOfLastSegmentUsed];
402
if (indexOfLastSegmentUsed == (routeSegment.
Parts
.Count - 1))
491
if (lastIndex == 0 || routeSegment.
Parts
[0].IsParameter)
Patterns\RoutePatternParser.cs (3)
322
for (var j = 0; j < segment.
Parts
.Count; j++)
324
var part = segment.
Parts
[j];
327
(i != segments.Count - 1 || j != segment.
Parts
.Count - 1))
Patterns\RoutePatternPathSegment.cs (2)
35
public bool IsSimple =>
Parts
.Count == 1;
44
return DebuggerToString(
Parts
);
Template\RoutePrecedence.cs (4)
179
if (pathSegment.
Parts
.Count > 1)
184
var part = pathSegment.
Parts
[0];
251
if (pathSegment.
Parts
.Count > 1)
257
var part = pathSegment.
Parts
[0];
Template\TemplateBinder.cs (1)
521
var parts = segments[i].
Parts
;
Template\TemplateSegment.cs (2)
32
var partCount = other.
Parts
.Count;
36
Parts.Add(new TemplatePart(other.
Parts
[i]));
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcherBuilder.cs (1)
25
.Select(s => s.IsSimple && s.
Parts
[0] is RoutePatternLiteralPart literalPart ? literalPart.Content : null)
Microsoft.AspNetCore.Routing.Tests (24)
Matching\BarebonesMatcherBuilder.cs (1)
25
.Select(s => s.IsSimple && s.
Parts
[0] is RoutePatternLiteralPart literalPart ? literalPart.Content : null)
Patterns\RoutePatternFactoryTest.cs (9)
690
Assert.Equal(3, actual.
Parts
.Count);
691
Assert.Same(paramPartB, actual.
Parts
[0]);
692
Assert.Same(paramPartC, actual.
Parts
[1]);
693
Assert.Same(paramPartD, actual.
Parts
[2]);
711
Assert.Equal(3, actual.
Parts
.Count);
712
Assert.Same(paramPartB, actual.
Parts
[0]);
713
Assert.Same(paramPartC, actual.
Parts
[1]);
714
Assert.Same(paramPartD, actual.
Parts
[2]);
741
var part = Assert.IsType<RoutePatternLiteralPart>(Assert.Single(segment.
Parts
));
Patterns\RoutePatternParserTest.cs (5)
666
if (x.PathSegments[i].
Parts
.Count != y.PathSegments[i].
Parts
.Count)
671
for (int j = 0; j < x.PathSegments[i].
Parts
.Count; j++)
673
if (!Equals(x.PathSegments[i].
Parts
[j], y.PathSegments[i].
Parts
[j]))
Template\TemplateSegmentTest.cs (9)
36
Assert.Equal(4, routePatternPathSegment.
Parts
.Count);
37
Assert.IsType<RoutePatternParameterPart>(routePatternPathSegment.
Parts
[0]);
38
Assert.Equal(paramPartC.Name, ((RoutePatternParameterPart)routePatternPathSegment.
Parts
[0]).Name);
39
Assert.IsType<RoutePatternLiteralPart>(routePatternPathSegment.
Parts
[1]);
40
Assert.Equal(literalPartA.Content, ((RoutePatternLiteralPart)routePatternPathSegment.
Parts
[1]).Content);
41
Assert.IsType<RoutePatternSeparatorPart>(routePatternPathSegment.
Parts
[2]);
42
Assert.Equal(separatorPartE.Content, ((RoutePatternSeparatorPart)routePatternPathSegment.
Parts
[2]).Content);
43
Assert.IsType<RoutePatternParameterPart>(routePatternPathSegment.
Parts
[3]);
44
Assert.Equal(paramPartB.Name, ((RoutePatternParameterPart)routePatternPathSegment.
Parts
[3]).Name);