My actions in ASP.NET MVC controller are decorated with numerous properties like this
[OutputCache(Duration = 86400, Location = OutputCacheLocation.Client,
VaryByParam = "jsPath;ServerHost")]
[CompressFilter]
public JavaScriptResult GetPendingJavaScript(string jsPath, string serverHost)
What I would like to do is to wrap this in something like #if and #endif, and have DebugMode setting in my web.config file. When this setting would be set to true, the decorating properties should be disregarded - I want to enable debug mode and in debug mode no compression and caching should occur.
So essentially it would be like commenting out those decorating properties (what I'm actually doing now and got fed up with it):
//[OutputCache(Duration = 86400, Location = OutputCacheLocation.Client,
// VaryByParam = "jsPath;ServerHost")]
//[CompressFilter]
Obviously #if and #endif work with defined (#define) C# symbols, I couldn't find any example where this would work with other types of condition (like web.config values, etc.).
Help appreciated