Answer the question
In order to leave comments, you need to log in
Redefining Attribute?
Hello! Help put me on the right path :)
There is a huge number of controllers. Some controllers require an attribute to be hooked. For example:
[CustomAttribute("Area")]
public class OneApiController : ApiController
{
....
[CustomAttribute(Role = "admin,user")]
public string Method1() { return ""; }
[CustomAttribute(Role = "user")]
public string Method2() { return ""; }
...
[CustomAttribute(User = "Ololosh")]
public string MethodN() { return ""; }
...
}
public class OneApiController : ApiController
{
....
[CustomAttribute("Area", Role = "admin,user")]
public string Method1() { return ""; }
[CustomAttribute("Area", Role = "user")]
public string Method2() { return ""; }
...
[CustomAttribute("Area", User = "Ololosh")]
public string MethodN() { return ""; }
...
}
Answer the question
In order to leave comments, you need to log in
Can't this be done at the controller level? Or do you want to hang 1 attribute globally, and then hang only input parameters for each property?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question