public HealthCheckMiddleware(
     RequestDelegate next,
     IHealthChecker healthChecker, HealthCheckOptions options)
 {
     _next          = next;
     _healthChecker = healthChecker ?? throw new ArgumentNullException(nameof(healthChecker));
     _options       = options;
 }
Beispiel #2
0
        public static IApplicationBuilder UseHealthCheck(this IApplicationBuilder app, Action <HealthCheckOptions> setupAction)
        {
            var options = new HealthCheckOptions();

            setupAction?.Invoke(options);

            app.UseMiddleware <HealthCheckMiddleware>(options);

            return(app);
        }