Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
/// <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