Last post Feb 26, 2021 10:35 AM by valenciano8
Feb 25, 2021 04:01 PM|valenciano8|LINK
I'm just wondering if there is a way to precise the ControllerRoute instead of the traditional :
Indeed let's take this example :
A web app has 4 controllers :
But I want to create an Admin Panel which will handle data of Controller A to C with Admin Role.
My wish is to reorganize the Controller Folder structure like so :
Is that possible ? If so, how to extend "asp-controller" tag scope ?
Otherwise I can simply put the methods inside each controller with the [Authorize(Role="Admin")] but I'm just asking ;)
Feb 25, 2021 09:35 PM|bruce (sqlwork.com)|LINK
It does not matter what folder you put controllers in, only the controller class name matters. Maybe you want areas?
Feb 26, 2021 10:35 AM|valenciano8|LINK
Thanks a lot for your answer, that's exactly what I was looking for !
Here is my new route :
// Important : you have to always follow this order to make the asp-area tag work otherwise it will take "default" as a route option
Now I can have access to /Admin/User/Users to manage my users ;)