What I am trying to do is something like this:
services
.AddRazorPages()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddAreaPageRoute("Products", "/DownloadDoc", "Products/{keycode}/{keycode}-document.pdf");
});
So if keycode was productTest, the url generated should be:
Products/productTest/productTest-document.pdf
Not sure if it is possible or not?
Currently it throws this error:
RoutePatternException: The route parameter name 'keycode' appears more than one time in the route template.
I have even tried things like this:
options.Conventions.AddAreaPageRoute("Products", "/DownloadDoc", "Products/{keycode2:keycode}/{keycode}-document.pdf");