Пример #1
0
        public IActionResult Get()
        {
            var serviceHealth = _healthService.CheckServiceHealth();

            serviceHealth.ControllerHealthy = true;

            if (serviceHealth.ControllerHealthy && serviceHealth.ServiceHealthy && serviceHealth.DataAccessHealthy)
            {
                serviceHealth.HealthMessage = "The API is working correctly.";
            }
            else
            {
                serviceHealth.HealthMessage = "One or more components of the API are malfunctioning.";
            }

            return(Ok(serviceHealth));
        }