Services - NeoSOFT-Technologies/rest-dot-net-core GitHub Wiki
For server-side assets, an abstract service base type is generated. The base type contains the definitions of all the gRPC calls contained in the .proto file. Create a concrete service implementation that derives from this base type and implements the logic for the gRPC calls. For the greet.proto, the example described previously, an abstract GreeterBase type that contains a virtual SayHello method is generated. A concrete implementation GreeterService overrides the method and implements the logic handling the gRPC call.
public class GreeterService : Greeter.GreeterBase
{
private readonly ILogger<GreeterService> _logger;
public GreeterService(ILogger<GreeterService> logger)
{
_logger = logger;
}
public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
{
return Task.FromResult(new HelloReply
{
Message = "Hello " + request.Name
});
}
}
BloomRPC aims to provide the simplest and most efficient developer experience for exploring and querying your GRPC services. Install the client, select your protobuf files and start making requests! No extra steps or configuration needed.