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