public override HealthCheck Check()
        {
            var enabledProviders = _providerFactory.GetAvailableProviders();
            var backOffProviders = enabledProviders.Join(_providerStatusService.GetBlockedProviders(),
                                                         i => i.Definition.Id,
                                                         s => s.ProviderId,
                                                         (i, s) => new { ImportList = i, Status = s })
                                   .ToList();

            if (backOffProviders.Empty())
            {
                return(new HealthCheck(GetType()));
            }

            if (backOffProviders.Count == enabledProviders.Count)
            {
                return(new HealthCheck(GetType(), HealthCheckResult.Error, "All import lists are unavailable due to failures", "#import-lists-are-unavailable-due-to-failures"));
            }

            return(new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format("Import lists unavailable due to failures: {0}", string.Join(", ", backOffProviders.Select(v => v.ImportList.Definition.Name))), "#import-lsits-are-unavailable-due-to-failures"));
        }
        public override HealthCheck Check()
        {
            var enabledProviders = _providerFactory.GetAvailableProviders();
            var backOffProviders = enabledProviders.Join(_providerStatusService.GetBlockedProviders(),
                                                         i => i.Definition.Id,
                                                         s => s.ProviderId,
                                                         (i, s) => new { Provider = i, Status = s })
                                   .ToList();

            if (backOffProviders.Empty())
            {
                return(new HealthCheck(GetType()));
            }

            if (backOffProviders.Count == enabledProviders.Count)
            {
                return(new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("ImportListStatusCheckAllClientMessage"), "#lists-are-unavailable-due-to-failures"));
            }

            return(new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format(_localizationService.GetLocalizedString("ImportListStatusCheckSingleClientMessage"), string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))), "#lists-are-unavailable-due-to-failures"));
        }