I have some Action Attributes that allow parameters. Here's what it looks like:
[DeleteActionCache(Action="GetTerms")] public ActionResult AddTerm(string term){ } public ActionResult GetTerms() {}
Now I want to get rid of the "GetTerms" magic string in my attribute. So I would prefer something like: (Pseudocode, not working)
[DeleteActionCache(Action=this.GetTerms().GetType().Name)]
Having an extra property inside my attribute class and executing the "Method2String" -Conversion inside my class will be fine with me if necessary to achieve what I want.
Info: I'm not looking for a way to get the name of the current method (MethodBase.GetCurrentMethod)
source share