0
我想根据调试标志设置一个方法属性。我预计会有编译时间问题。也许有人可以想到一种解决方法,它的工作原理类似于它的工作原理。Asp.Net Mvc方法基于HttpContext.Current.IsDebuggingEnabled的OutputCache属性集
[OutputCache(
NoStore = HttpContext.Current.IsDebuggingEnabled,
Duration=(HttpContext.Current.IsDebuggingEnabled)?0:15
)]///TODO: REMOVE THIS Attribute AFTER TESTING!
public ActionResult RenderSomething(int somethingID)
{
...
}