/// <summary> /// Adds a <see cref="DelegatingHealthCheck"/> to the services. /// </summary> /// <param name="builder">The health check builder</param> /// <param name="name">The health check name</param> /// <param name="action">The action to execute to get the health check status</param> /// <param name="required">Is the health check required?</param> /// <param name="tags">The collection of tags</param> /// <returns>The builder after changes</returns> /// <exception cref="ArgumentNullException"></exception> public static IHealthCheckBuilder AddDelegate(this IHealthCheckBuilder builder, string name, Func <CancellationToken, Task <HealthCheckStatus> > action, bool required = false, params string[] tags) { return(builder.AddDelegate(new DelegatingHealthCheckProperties(name, action, required, tags))); }