Suppose I have a controller that has routes to roles and other routers for other roles. I want the code to be cleaner by dividing these routes into partial classes. I know I can do it.
But I would like to know if I can do this:
[Authorize(Roles = "Admin")]
[MyLogger]
public partial class TheController{
}
and
[Authorize(Roles = "OtherRole")]
public partial class TheController{
}
and
[AllowAnonymous]
public partial class TheController{
}
and the routes within each partial class receive only the attributes of that partial class.
Is it possible?
source
share