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)
{
...
}