5
我有一些允许参数的动作属性。这是它的样子:获取行为名称作为属性参数的字符串
[DeleteActionCache(Action="GetTerms")]
public ActionResult AddTerm(string term){ }
public ActionResult GetTerms() {}
现在我想摆脱我的属性中的魔术字符串“GetTerms”。所以,我宁愿是这样的:(伪代码,不工作)
[DeleteActionCache(Action=this.GetTerms().GetType().Name)]
有我的属性级内的附加属性和做“Method2String” -Conversions在我的这个类将是确定与我,如果这是需要达到我想要的。
信息:我不寻找一种方式将得到当前方法名(MethodBase.GetCurrentMethod)