I have an ASP.NET Core 6 Web Api
application.
I have a Grpc Client
and a Grpc Server
.
I have a proto file:
service FooService {
rpc GetFirstData (FirstRequest) returns (FirstResult);
rpc GetAnotherData (AnotherRequest) returns (AnotherResult);
}
In the Grpc Client
I have 2 services which take FooClient
as a parameter. The first service sends GetFirstData request
and the second Service sends GetAnotherData request
to the Grpc Server
. There are no issues here.
With the server, however, if I try to add 2 services, I get a Server Error 500.
public class FirstServerService : Protos.FooService.FooServiceBase
{
public override Task<FirstResult> GetFirstData (FirstRequest request, ServerCallContext context)
{
}
}
public class AnotherServerService : Protos.FooService.FooServiceBase
{
public override Task<AnotherResult> GetAnotherData (AnotherRequest request, ServerCallContext context)
{
}
}
The question is: Is it possible to have multiple services on the backend implementing methods from the same Proto file?