Class ServiceCollectionExtensions
Static class to provide extension methods to configure API clients.
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Google.Shopping.Merchant.Promotions.V1Beta.dll
Syntax
public static class ServiceCollectionExtensions
Methods
AddPromotionsServiceClient(IServiceCollection, Action<PromotionsServiceClientBuilder>)
Adds a singleton PromotionsServiceClient to services.
Declaration
public static IServiceCollection AddPromotionsServiceClient(this IServiceCollection services, Action<PromotionsServiceClientBuilder> action = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The service collection to add the client to. The services are used to configure the client when requested. |
| Action<PromotionsServiceClientBuilder> | action | An optional action to invoke on the client builder. This is invoked before services from
|
Returns
| Type | Description |
|---|---|
| IServiceCollection |
AddPromotionsServiceClient(IServiceCollection, Action<IServiceProvider, PromotionsServiceClientBuilder>)
Adds a singleton PromotionsServiceClient to services.
Declaration
public static IServiceCollection AddPromotionsServiceClient(this IServiceCollection services, Action<IServiceProvider, PromotionsServiceClientBuilder> action)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The service collection to add the client to. The services are used to configure the client when requested. |
| Action<IServiceProvider, PromotionsServiceClientBuilder> | action | An optional action to invoke on the client builder. This is invoked before services from
|
Returns
| Type | Description |
|---|---|
| IServiceCollection |