Created
March 11, 2015 15:25
-
-
Save davidknipe/d17dffe6a05171ee91f2 to your computer and use it in GitHub Desktop.
Debugger aware ContentOutputCacheAttribute for EPiServer - only output caches if a debugger is not attached
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class DebugAwareContentOutputCacheAttribute : ContentOutputCacheAttribute | |
| { | |
| public override bool Disable | |
| { | |
| get | |
| { | |
| if (System.Diagnostics.Debugger.IsAttached) | |
| { | |
| return true; | |
| } | |
| else | |
| { | |
| return base.Disable; | |
| } | |
| } | |
| set | |
| { | |
| base.Disable = value; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment