public HealthResult CheckHealth() { (var status, var description, IReadOnlyDictionary <string, EndpointHealthResult> results) = _endpointHealth.CheckHealth(); var exception = results.Where(x => x.Value.Exception != null).Select(x => x.Value.Exception).FirstOrDefault(); return(_healthy && status == BusHealthStatus.Healthy ? HealthResult.Healthy("Ready", results) : _healthy && status == BusHealthStatus.Degraded ? HealthResult.Degraded(description, exception, results) : HealthResult.Unhealthy($"Not ready: {_failureMessage}", exception, results)); }