Last active
December 14, 2015 08:59
-
-
Save eralston/5061708 to your computer and use it in GitHub Desktop.
A simple static class in C# for ASP.Net MVC 4 that extends @html with a method for checking if the current build is debug or release
This file contains 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
/// <summary> | |
/// Class for holding extensions for the HtmlHelper function | |
/// </summary> | |
public static class HtmlHelperExtensions | |
{ | |
/// <summary> | |
/// Returns true if the build is DEBUG; otherwise, returns false | |
/// </summary> | |
/// <param name="htmlHelper"></param> | |
/// <returns></returns> | |
public static bool IsDebug(this HtmlHelper htmlHelper) | |
{ | |
#if DEBUG | |
return true; | |
#else | |
return false; | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment