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