In raw gRPC / .proto terms, this is service
:
service MyService {
rpc SomeMethod (SomeDtoDefinedSomewhere) returns (AnotherDtoDefinedSomewhere);
rpc AnotherMethod (Blah) returns (Whatever);
}
Now; what happens next depends on the tools you're using; protoc
will generate a client proxy and server stub for this, not a C# interface. You can either work with this "as is", or add your own interface as an abstraction.
However, protobuf-net (a separate implementation of protobuf on .NET) can work with this as a pure C# interface via protogen
. Unfortunately, I have not yet updated the website with the tweaks to actually emit service definitions as interfaces. But it should work from the nuget preview drops.