/// <summary> /// Create a failure (degraded or unhealthy) status response. /// </summary> /// <param name="message">Status message.</param> /// <param name="degradedOnError"> /// If true, create a degraded status response. /// Otherwise create an unhealthy status response. (default: false) /// </param> /// <returns>Failure status response.</returns> private static HealthCheckResult HealthCheckResultOnError(string message, bool degradedOnError) { return(degradedOnError ? HealthCheckResult.Degraded(message) : HealthCheckResult.Unhealthy(message)); }