The default routing for my ASP.NET Core is as defaulted by VS2015 to be:
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
When I make my request URL /my-controller/my-special-view it indeed calls the method in my my-control that is defined as follows with the id parameter equal to my-special-value
public IActionResult my-controller(string id) {...
I'm trying to the same thing with attribute routing. I define the attribute as follows:
[Route("my-controller/{id}")]
public IActionResult my-controller(string id) {...
I get an error as follows:
InvalidOperationException: The constraint entry 'attributeOfInterest' - 'string' on the route 'CacheTagHelper/{attributeOfInterest:string}' could not be resolved by the constraint resolver of type 'DefaultInlineConstraintResolver'.
I'm not experienced with attritube routing and do not understand why the above to controller methods don't give me the same results.