public HealthCheckMiddleware(
            RequestDelegate next,
            IOptions <HealthCheckOptions> healthCheckOptions,
            IHealthCheckService healthCheckService)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (healthCheckOptions == null)
            {
                throw new ArgumentNullException(nameof(healthCheckOptions));
            }

            if (healthCheckService == null)
            {
                throw new ArgumentNullException(nameof(healthCheckService));
            }

            _next = next;
            _healthCheckOptions = healthCheckOptions.Value;
            _healthCheckService = healthCheckService;

            _checks = FilterHealthChecks(_healthCheckService.Checks, healthCheckOptions.Value.HealthCheckNames);
        }
Esempio n. 2
0
        public HealthCheckMiddlewareAuth(
            RequestDelegate next,
            IOptions <HealthCheckOptions> healthCheckOptions,
            HealthCheckService healthCheckService)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

            if (healthCheckOptions == null)
            {
                throw new ArgumentNullException(nameof(healthCheckOptions));
            }

            if (healthCheckService == null)
            {
                throw new ArgumentNullException(nameof(healthCheckService));
            }

            _next = next;
            _healthCheckOptions = healthCheckOptions.Value;
            _healthCheckService = healthCheckService;
        }
 public HealthCheckMiddleware(RequestDelegate next, IOptions <HealthCheckOptions> healthCheckOptions, IHealthCheckService healthCheckService)
 {
     _next = next;
     _healthCheckOptions = healthCheckOptions.Value;
     _healthCheckService = healthCheckService;
 }