Ejemplo n.º 1
0
 public HealthCheckMiddleware(
     RequestDelegate next,
     IHealthChecker healthChecker, HealthCheckOptions options)
 {
     _next          = next;
     _healthChecker = healthChecker ?? throw new ArgumentNullException(nameof(healthChecker));
     _options       = options;
 }
Ejemplo n.º 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);
        }