แชร์ผ่าน


HealthCheckServiceCollectionExtensions.AddHealthChecks Method

Definition

Adds the HealthCheckService to the container, using the provided delegate to register health checks.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHealthChecksBuilder ^ AddHealthChecks(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder AddHealthChecks (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddHealthChecks : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder
<Extension()>
Public Function AddHealthChecks (services As IServiceCollection) As IHealthChecksBuilder

Parameters

Returns

An instance of IHealthChecksBuilder from which health checks can be registered.

Remarks

This operation is idempotent - multiple invocations will still only result in a single HealthCheckService instance in the IServiceCollection. It can be invoked multiple times in order to get access to the IHealthChecksBuilder in multiple places.

Applies to