Class ServiceCollectionExtensions (4.0.0)

public static class ServiceCollectionExtensions

Static class to provide extension methods to configure API clients.

Inheritance

Object > ServiceCollectionExtensions

Namespace

Microsoft.Extensions.DependencyInjection

Assembly

Google.Cloud.Logging.V2.dll

Methods

AddConfigServiceV2Client(IServiceCollection, Action<ConfigServiceV2ClientBuilder>)

public static IServiceCollection AddConfigServiceV2Client(this IServiceCollection services, Action<ConfigServiceV2ClientBuilder> action = null)

Adds a singleton ConfigServiceV2Client to services.

Parameters
NameDescription
servicesIServiceCollection

The service collection to add the client to. The services are used to configure the client when requested.

actionAction<ConfigServiceV2ClientBuilder>

An optional action to invoke on the client builder. This is invoked before services from services are used.

Returns
TypeDescription
IServiceCollection

AddLoggingServiceV2Client(IServiceCollection, Action<LoggingServiceV2ClientBuilder>)

public static IServiceCollection AddLoggingServiceV2Client(this IServiceCollection services, Action<LoggingServiceV2ClientBuilder> action = null)

Adds a singleton LoggingServiceV2Client to services.

Parameters
NameDescription
servicesIServiceCollection

The service collection to add the client to. The services are used to configure the client when requested.

actionAction<LoggingServiceV2ClientBuilder>

An optional action to invoke on the client builder. This is invoked before services from services are used.

Returns
TypeDescription
IServiceCollection

AddMetricsServiceV2Client(IServiceCollection, Action<MetricsServiceV2ClientBuilder>)

public static IServiceCollection AddMetricsServiceV2Client(this IServiceCollection services, Action<MetricsServiceV2ClientBuilder> action = null)

Adds a singleton MetricsServiceV2Client to services.

Parameters
NameDescription
servicesIServiceCollection

The service collection to add the client to. The services are used to configure the client when requested.

actionAction<MetricsServiceV2ClientBuilder>

An optional action to invoke on the client builder. This is invoked before services from services are used.

Returns
TypeDescription
IServiceCollection