64 writes to Template
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
DefaultApiDescriptionProviderTest.cs (11)
176
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
222
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
255
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= "api/products" };
284
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
329
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
360
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
385
action.AttributeRouteInfo = new AttributeRouteInfo {
Template
= template };
411
Template
= template
429
Template
= "api/Products/{id1}-{id2:int}"
453
Template
= "api/Products/{id1}-{id2}/{id3:int}/{id4:int?}/{*id5:int}"
476
Template
= "api/Products/UpdateProduct/{productId}"
Microsoft.AspNetCore.Mvc.Core (1)
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
203
Template
= selectorModel.AttributeRouteModel.Template,
Microsoft.AspNetCore.Mvc.Core.Test (39)
Infrastructure\ActionSelectionTableTest.cs (2)
252
Template
= "/Home",
282
Template
= "/Home",
Infrastructure\ActionSelectorTest.cs (1)
199
Template
= "/Home",
Routing\ActionEndpointFactoryTest.cs (1)
473
Template
= pattern
Routing\AttributeRouteTest.cs (25)
36
Template
= "api/Blog/{key1}"
43
Template
= "api/Store/Buy/{key2}"
122
Template
= "api/Blog/{id}",
166
Template
= "api/Blog/{id:int}",
210
Template
= "api/Blog/{*slug=hello}",
257
Template
= "api/Blog/{id}",
271
Template
= "api/Blog/{id}",
325
Template
= "api/Blog/{id}",
368
Template
= "api/Blog/{id:int}",
411
Template
= "api/Blog/{*slug=hello}",
459
Template
= "api/Blog/{id}",
473
Template
= "api/Blog/{id}",
519
Template
= routeTemplate,
550
Template
= "blog/get/{id}",
559
Template
= "blog/{snake-cased-name}",
567
Template
= "blog/",
606
Template
= "blog/get/{id}",
615
Template
= "blog/get/{id}",
623
Template
= "blog/",
662
Template
= "blog/get/{id}",
671
Template
= "blog/{snake-cased-name}",
679
Template
= "blog/",
718
Template
= "blog/get/{id}",
727
Template
= "blog/get/{id}",
735
Template
= "blog/",
Routing\AttributeRoutingTest.cs (2)
125
action.AttributeRouteInfo.
Template
= "{controller}/{action}";
153
AttributeRouteInfo = new AttributeRouteInfo {
Template
= template },
Routing\ControllerActionEndpointDataSourceTest.cs (8)
26
Template
= "/test",
58
Template
= "/test",
138
Template
= "/test",
219
Template
= "/test",
307
Template
= "/test",
388
Template
= "/test",
489
Template
= "/test",
577
Template
= pattern,
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageActionDescriptorProvider.cs (1)
98
Template
= TransformPageRoute(model, selector),
Microsoft.AspNetCore.Mvc.RazorPages.Test (11)
Infrastructure\DefaultPageLoaderTest.cs (4)
109
Template
= "/test",
226
Template
= "/test",
280
Template
= "/test",
288
Template
= "/test",
Infrastructure\PageActionEndpointDataSourceTest.cs (7)
27
Template
= "/test",
59
Template
= "/test",
103
Template
= "/test",
116
Template
= "/test2",
181
Template
= "/test",
223
Template
= "/test",
285
Template
= pattern,
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
221
Template
= action.MethodInfo.GetCustomAttribute<RouteAttribute>()?.Template,
59 references to Template
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (2)
377
if (action.AttributeRouteInfo?.
Template
!= null)
379
return TemplateParser.Parse(action.AttributeRouteInfo.
Template
);
Microsoft.AspNetCore.Mvc.Core (5)
Routing\ActionEndpointFactory.cs (3)
83
if (action.AttributeRouteInfo?.
Template
== null)
130
var attributeRoutePattern = RoutePatternFactory.Parse(action.AttributeRouteInfo.
Template
);
322
attributeRoutePattern = RoutePatternFactory.Parse(action.AttributeRouteInfo!.
Template
!, updatedDefaults, parameterPolicies: null);
Routing\AttributeRoute.cs (2)
147
var attributeRoutedActions = actions.Where(a => a.AttributeRouteInfo?.
Template
!= null);
189
var template = action.AttributeRouteInfo!.
Template
!;
Microsoft.AspNetCore.Mvc.Core.Test (41)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (41)
109
Assert.Equal("Items", descriptor.AttributeRouteInfo.
Template
);
412
Assert.Equal("api/Token/value/TokenReplacement/stub/ThisIsAnAction", action.AttributeRouteInfo.
Template
);
462
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v1/List"));
463
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v1/All"));
464
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v2/List"));
465
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v2/All"));
492
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v1/List"));
493
Assert.Single(actions, a => a.AttributeRouteInfo.
Template
.Equals("v2/List"));
517
Assert.Equal("Override", action.AttributeRouteInfo.
Template
);
538
Assert.NotNull(action.AttributeRouteInfo.
Template
);
548
Assert.Single(putActions, a => a.AttributeRouteInfo.
Template
.Equals("v1/All"));
549
Assert.Single(putActions, a => a.AttributeRouteInfo.
Template
.Equals("v2/All"));
555
Assert.Single(routeActions, a => a.AttributeRouteInfo.
Template
.Equals("v1/List"));
556
Assert.Single(routeActions, a => a.AttributeRouteInfo.
Template
.Equals("v2/List"));
577
Assert.NotNull(action.AttributeRouteInfo.
Template
);
587
Assert.Single(postActions, a => a.AttributeRouteInfo.
Template
.Equals("v1"));
588
Assert.Single(postActions, a => a.AttributeRouteInfo.
Template
.Equals("v2"));
594
Assert.Single(putActions, a => a.AttributeRouteInfo.
Template
.Equals("v1/All"));
595
Assert.Single(putActions, a => a.AttributeRouteInfo.
Template
.Equals("v2/All"));
600
Assert.Single(unconstrainedActions, a => a.AttributeRouteInfo.
Template
.Equals("v1/List"));
601
Assert.Single(unconstrainedActions, a => a.AttributeRouteInfo.
Template
.Equals("v2/List"));
623
controllerAndAction.AttributeRouteInfo.
Template
,
624
controllerActionAndOverride.AttributeRouteInfo.
Template
,
652
Assert.Equal("Products/list", action.AttributeRouteInfo.
Template
);
747
Assert.Equal("Products/Index", action.AttributeRouteInfo.
Template
);
794
Assert.Equal("{id}", descriptor.AttributeRouteInfo.
Template
, StringComparer.OrdinalIgnoreCase);
817
Assert.Equal("Products/Get", getAction.AttributeRouteInfo.
Template
, StringComparer.OrdinalIgnoreCase);
823
Assert.Equal("Products/Edit", editAction.AttributeRouteInfo.
Template
, StringComparer.OrdinalIgnoreCase);
847
getAction.AttributeRouteInfo.
Template
, StringComparer.OrdinalIgnoreCase);
857
editAction.AttributeRouteInfo.
Template
, StringComparer.OrdinalIgnoreCase);
926
Assert.Equal("stub/ThisIsAnAction", action.AttributeRouteInfo.
Template
);
941
Assert.Equal("stub/{controller}/{action}", action.AttributeRouteInfo.
Template
);
1190
var action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "R1");
1196
action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "R2");
1216
var action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C1/A1");
1222
action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C2/A1");
1243
var action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C1/A3");
1249
action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C2/A3");
1255
action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C1/A4");
1261
action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "C2/A4");
1282
var action = Assert.Single(actions, a => a.AttributeRouteInfo.
Template
== "A2");
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\PageApplicationModel.cs (1)
104
public string? RouteTemplate => ActionDescriptor.AttributeRouteInfo?.
Template
;
Microsoft.AspNetCore.Mvc.RazorPages.Test (10)
Infrastructure\PageActionDescriptorProviderTest.cs (10)
64
Assert.Equal("/Test/{id:int?}", descriptor.AttributeRouteInfo.
Template
);
165
Assert.Equal("Accounts/Test/{id:int?}", descriptor.AttributeRouteInfo.
Template
);
284
result => Assert.Equal("base-path/Test/Home", result.AttributeRouteInfo.
Template
),
285
result => Assert.Equal("base-path/Index", result.AttributeRouteInfo.
Template
),
286
result => Assert.Equal("base-path/", result.AttributeRouteInfo.
Template
),
287
result => Assert.Equal("base-path/Admin/Index", result.AttributeRouteInfo.
Template
),
288
result => Assert.Equal("base-path/Admin", result.AttributeRouteInfo.
Template
),
289
result => Assert.Equal("base-path/Admin/User", result.AttributeRouteInfo.
Template
));
333
Assert.Equal("/Catalog/Details/Index/{id:int?}", descriptor.AttributeRouteInfo.
Template
);
340
Assert.Equal("/Catalog/Details/{id:int?}", descriptor.AttributeRouteInfo.
Template
);