-
Notifications
You must be signed in to change notification settings - Fork 0
Grpc: Services
ronimizy edited this page Feb 10, 2024
·
3 revisions
Use AddPlatformGrpcServices extension method on IServiceCollection to configure gRPC services located on your server. This extension will register grpc and grpc server reflection in DI.
collection.AddPlatformGrpcServices();You can configure interceptors for your services by passing a delegate to AddPlatformGrpcServices and calling AddInterceptor on provided builder.
collection.AddPlatformGrpcServices(services => services
.AddInterceptor<SampleServiceInterceptor>());You can register a handler that process header on each incoming request via implementing IPlatformGrpcHeaderHandler interface and calling AddHeaderHandler on builder provided by AddPlatformGrpcServices.
collection.AddPlatformGrpcServices(services => services
.AddHeaderHandler<HeaderHandler>());