HealthChecksBuilderDelegateExtensions.AddAsyncCheck Method

Definition

Overloads

AddAsyncCheck(IHealthChecksBuilder, String, Func<CancellationToken,Task<HealthCheckResult>>, IEnumerable<String>)

Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs

Adds a new health check with the specified name and implementation.

C#
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAsyncCheck(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string name, Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> check, System.Collections.Generic.IEnumerable<string> tags);

Parameters

name
String

The name of the health check.

check
Func<CancellationToken,Task<HealthCheckResult>>

A delegate that provides the health check implementation.

tags
IEnumerable<String>

A list of tags that can be used to filter health checks.

Returns

The IHealthChecksBuilder.

Applies to

.NET 10 (package-provided) ja .NET Standard 2.0 (package-provided)
Tuote Versiot
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)

AddAsyncCheck(IHealthChecksBuilder, String, Func<Task<HealthCheckResult>>, IEnumerable<String>)

Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs

Adds a new health check with the specified name and implementation.

C#
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAsyncCheck(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string name, Func<System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> check, System.Collections.Generic.IEnumerable<string> tags);

Parameters

name
String

The name of the health check.

check
Func<Task<HealthCheckResult>>

A delegate that provides the health check implementation.

tags
IEnumerable<String>

A list of tags that can be used to filter health checks.

Returns

The IHealthChecksBuilder.

Applies to

.NET 10 (package-provided) ja .NET Standard 2.0 (package-provided)
Tuote Versiot
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)

AddAsyncCheck(IHealthChecksBuilder, String, Func<CancellationToken,Task<HealthCheckResult>>, IEnumerable<String>, Nullable<TimeSpan>)

Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs

Adds a new health check with the specified name and implementation.

C#
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAsyncCheck(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string name, Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> check, System.Collections.Generic.IEnumerable<string>? tags = default, TimeSpan? timeout = default);

Parameters

name
String

The name of the health check.

check
Func<CancellationToken,Task<HealthCheckResult>>

A delegate that provides the health check implementation.

tags
IEnumerable<String>

A list of tags that can be used to filter health checks.

timeout
Nullable<TimeSpan>

An optional TimeSpan representing the timeout of the check.

Returns

The IHealthChecksBuilder.

Applies to

.NET 10 (package-provided) ja .NET Standard 2.0 (package-provided)
Tuote Versiot
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)

AddAsyncCheck(IHealthChecksBuilder, String, Func<Task<HealthCheckResult>>, IEnumerable<String>, Nullable<TimeSpan>)

Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs
Source:
HealthChecksBuilderDelegateExtensions.cs

Adds a new health check with the specified name and implementation.

C#
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddAsyncCheck(this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string name, Func<System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> check, System.Collections.Generic.IEnumerable<string>? tags = default, TimeSpan? timeout = default);

Parameters

name
String

The name of the health check.

check
Func<Task<HealthCheckResult>>

A delegate that provides the health check implementation.

tags
IEnumerable<String>

A list of tags that can be used to filter health checks.

timeout
Nullable<TimeSpan>

An optional TimeSpan representing the timeout of the check.

Returns

The IHealthChecksBuilder.

Applies to

.NET 10 (package-provided) ja .NET Standard 2.0 (package-provided)
Tuote Versiot
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)