Class GrpcServicesExtensions
Extension methods for the gRPC services.
Inheritance
System.Object
GrpcServicesExtensions
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Grpc.AspNetCore.Server.dll
Syntax
public static class GrpcServicesExtensions : object
Methods
AddGrpc(IServiceCollection)
Adds gRPC services to the specified
Declaration
public static IGrpcServerBuilder AddGrpc(this IServiceCollection services)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Returns
Type | Description |
---|---|
IGrpcServerBuilder | An IGrpcServerBuilder that can be used to further configure the gRPC services. |
AddGrpc(IServiceCollection, Action<GrpcServiceOptions>)
Adds gRPC services to the specified
Declaration
public static IGrpcServerBuilder AddGrpc(this IServiceCollection services, Action<GrpcServiceOptions> configureOptions)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
Action<GrpcServiceOptions> | configureOptions | An |
Returns
Type | Description |
---|---|
IGrpcServerBuilder | An IGrpcServerBuilder that can be used to further configure the gRPC services. |
AddServiceOptions<TService>(IGrpcServerBuilder, Action<GrpcServiceOptions<TService>>)
Adds service specific options to an IGrpcServerBuilder.
Declaration
public static IGrpcServerBuilder AddServiceOptions<TService>(this IGrpcServerBuilder grpcBuilder, Action<GrpcServiceOptions<TService>> configure)
where TService : class
Parameters
Type | Name | Description |
---|---|---|
IGrpcServerBuilder | grpcBuilder | The IGrpcServerBuilder. |
Action<GrpcServiceOptions<TService>> | configure | A callback to configure the service options. |
Returns
Type | Description |
---|---|
IGrpcServerBuilder | The same instance of the IGrpcServerBuilder for chaining. |
Type Parameters
Name | Description |
---|---|
TService | The service type to configure. |