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