src/fursvp.api/Filters/DebugModeOnlyFilter.cs
/// <summary>
/// Throws an exception if the environment is not Development.
/// </summary>
/// <param name="context">The ActionExecutingContext.</param>
Throws an exception if the environment is not Development.
Throws an exception if the environment is not Development .
public override void OnActionExecuting(ActionExecutingContext context)
        {
            if (!WebHostEnvironment.IsDevelopment())
            {
                Logger.LogWarning("Attempt to access a debug-only controller.", context);
                throw new NotAuthorizedException<string>(string.Empty);
            }
            base.OnActionExecuting(context);
        }
public override void OnActionExecuting ( ActionExecutingContext context ) { if ( ! WebHostEnvironment . IsDevelopment ( ) ) { Logger . LogWarning ( " " , context ) ; throw new NotAuthorizedException < string > ( string . Empty ) ; } base . OnActionExecuting ( context ) ; }
Throws an exception if the environment is not Development.
Throws an exception if the environment is not Development .
context
ActionExecutingContext
None