public static HealthCheckBuilder AddCheck(this HealthCheckBuilder builder, string name, Func <CancellationToken, IHealthCheckResult> check, TimeSpan cacheDuration) { Guard.ArgumentNotNull(nameof(builder), builder); return(builder.AddCheck(name, HealthCheck.FromCheck(check), cacheDuration)); }
// Lambda versions of AddCheck for Func/Func<Task>/Func<ValueTask> public static HealthCheckBuilder AddCheck(this HealthCheckBuilder builder, string name, Func <IHealthCheckResult> check) { Guard.ArgumentNotNull(nameof(builder), builder); return(builder.AddCheck(name, HealthCheck.FromCheck(check), builder.DefaultCacheDuration)); }