HealthChecksBuilderDelegateExtensions.AddAsyncCheck 方法

定義

多載

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ AddAsyncCheck(Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ builder, System::String ^ name, Func<System::Threading::CancellationToken, System::Threading::Tasks::Task<Microsoft::Extensions::Diagnostics::HealthChecks::HealthCheckResult> ^> ^ check, System::Collections::Generic::IEnumerable<System::String ^> ^ tags);
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);
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);
static member AddAsyncCheck : Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder * string * Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> * seq<string> -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of CancellationToken, Task(Of HealthCheckResult)), Optional tags As IEnumerable(Of String) = Nothing) As IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of CancellationToken, Task(Of HealthCheckResult)), tags As IEnumerable(Of String)) As IHealthChecksBuilder

參數

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.

傳回

IHealthChecksBuilder

IHealthChecksBuilderThe IHealthChecksBuilder.

適用於

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ AddAsyncCheck(Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ builder, System::String ^ name, Func<System::Threading::Tasks::Task<Microsoft::Extensions::Diagnostics::HealthChecks::HealthCheckResult> ^> ^ check, System::Collections::Generic::IEnumerable<System::String ^> ^ tags);
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);
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);
static member AddAsyncCheck : Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder * string * Func<System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> * seq<string> -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of Task(Of HealthCheckResult)), Optional tags As IEnumerable(Of String) = Nothing) As IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of Task(Of HealthCheckResult)), tags As IEnumerable(Of String)) As IHealthChecksBuilder

參數

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.

傳回

IHealthChecksBuilder

IHealthChecksBuilderThe IHealthChecksBuilder.

適用於

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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);
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);
static member AddAsyncCheck : Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder * string * Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> * seq<string> * Nullable<TimeSpan> -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of CancellationToken, Task(Of HealthCheckResult)), Optional tags As IEnumerable(Of String) = Nothing, Optional timeout As Nullable(Of TimeSpan) = Nothing) As IHealthChecksBuilder

參數

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>

選擇性的 TimeSpan,代表檢查的時間。An optional TimeSpan representing the timeout of the check.

傳回

IHealthChecksBuilder

IHealthChecksBuilderThe IHealthChecksBuilder.

適用於

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

新增具有指定名稱和實作的新健康狀態檢查。Adds a new health check with the specified name and implementation.

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);
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);
static member AddAsyncCheck : Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder * string * Func<System.Threading.Tasks.Task<Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult>> * seq<string> * Nullable<TimeSpan> -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddAsyncCheck (builder As IHealthChecksBuilder, name As String, check As Func(Of Task(Of HealthCheckResult)), Optional tags As IEnumerable(Of String) = Nothing, Optional timeout As Nullable(Of TimeSpan) = Nothing) As IHealthChecksBuilder

參數

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>

選擇性的 TimeSpan,代表檢查的時間。An optional TimeSpan representing the timeout of the check.

傳回

IHealthChecksBuilder

IHealthChecksBuilderThe IHealthChecksBuilder.

適用於