I wish to add something to a razor page so that when I inspect the page code behind, I'm able to tell if it is in Production, Staging, or Development mode. In this case, I'm adding a hidden field to tell me what mode the page is in. It is not the cleanest looking code. Any ideas on a different approach to insert a status water mark of sorts into the rendered code?
@if (Env.IsProduction()) {<input type="hidden" name="EnvironmentName" id="EnvironmentName" value="Production" />}@if (Env.IsStaging()){<input type="hidden" name="EnvironmentName" id="EnvironmentName" value="Staging" />}@if (Env.IsDevelopment()){<input type="hidden" name="EnvironmentName" id="EnvironmentName" value="Development" />}The code behind currently looks like this:
