public static class GaxGrpcServiceCollectionExtensions
Extension methods for dependency injection.
Namespace
Microsoft.Extensions.DependencyInjectionAssembly
Google.Api.Gax.Grpc.dll
Methods
AddGrpcCoreAdapter(IServiceCollection)
public static IServiceCollection AddGrpcCoreAdapter(this IServiceCollection services)
Adds a singleton GrpcCoreAdapter to the given service collection as the preferred GrpcAdapter implementation.
Parameter | |
---|---|
Name | Description |
services | IServiceCollection The service collection to add the adapter to. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The same service collection reference, for method chaining. |
AddGrpcNetClientAdapter(IServiceCollection)
public static IServiceCollection AddGrpcNetClientAdapter(this IServiceCollection services)
Adds a singleton GrpcNetClientAdapter to the given service collection as the preferred GrpcAdapter implementation, such that any created uses the service provider from created this service collection. This enables logging, for example.
Parameter | |
---|---|
Name | Description |
services | IServiceCollection The service collection to add the adapter to. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The same service collection reference, for method chaining. |
AddGrpcNetClientAdapter(IServiceCollection, Action<IServiceProvider, Grpc.Net.Client.GrpcChannelOptions>)
public static IServiceCollection AddGrpcNetClientAdapter(this IServiceCollection services, Action<IServiceProvider, Grpc.Net.Client.GrpcChannelOptions> optionsConfigurer)
Adds a singleton GrpcNetClientAdapter to the given service collection
as the preferred GrpcAdapter implementation,
using the default instance with any additional options configured via optionsConfigurer
.
Before executing the specified action, the
is set to the provider. This enables logging, for example.
Parameters | |
---|---|
Name | Description |
services | IServiceCollection The service collection to add the adapter to. |
optionsConfigurer | Action<IServiceProvider, Grpc.Net.Client.GrpcChannelOptions> The configuration action to perform on each when it is used by the adapter to construct a channel. May be null, in which case this method only sets the service provider. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The same service collection reference, for method chaining. |
AddRestGrpcAdapter(IServiceCollection)
public static IServiceCollection AddRestGrpcAdapter(this IServiceCollection services)
Adds a singleton RestGrpcAdapter to the given service collection as the preferred GrpcAdapter implementation.
Parameter | |
---|---|
Name | Description |
services | IServiceCollection The service collection to add the adapter to. |
Returns | |
---|---|
Type | Description |
IServiceCollection | The same service collection reference, for method chaining. |