EntityFrameworkCoreHealthChecksBuilderExtensions.AddDbContextCheck<TContext> Method

Definition

public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddDbContextCheck<TContext> (this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string name = default, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable<string> tags = default, Func<TContext,System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>> customTestQuery = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddDbContextCheck<TContext> (this Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder builder, string? name = default, Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus? failureStatus = default, System.Collections.Generic.IEnumerable<string>? tags = default, Func<TContext,System.Threading.CancellationToken,System.Threading.Tasks.Task<bool>>? customTestQuery = default) where TContext : Microsoft.EntityFrameworkCore.DbContext;
static member AddDbContextCheck : Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder * string * Nullable<Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus> * seq<string> * Func<'Context, System.Threading.CancellationToken, System.Threading.Tasks.Task<bool> (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)> -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder (requires 'Context :> Microsoft.EntityFrameworkCore.DbContext)
<Extension()>
Public Function AddDbContextCheck(Of TContext As DbContext) (builder As IHealthChecksBuilder, Optional name As String = Nothing, Optional failureStatus As Nullable(Of HealthStatus) = Nothing, Optional tags As IEnumerable(Of String) = Nothing, Optional customTestQuery As Func(Of TContext, CancellationToken, Task(Of Boolean)) = Nothing) As IHealthChecksBuilder

Type Parameters

TContext

Parameters

name
String
failureStatus
Nullable<HealthStatus>
customTestQuery
Func<TContext,CancellationToken,Task<Boolean>>

Returns

IHealthChecksBuilder

Applies to