My requirement maybe a bit of 'weird' in many people's opinion:
So given a proto file like bellow:
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply);
}
I want to generate the POCOs and corresponding interfaces (instead of concrete gRPC services) like bellow:
public class HelloRequest
{
public string Name { get; set; }
}
public class HelloReply
{
public string Message { get; set; }
}
public interface IGreeterService
{
public HelloReply SayHello(HelloRequest request);
}
That is, I only use proto files as some kind of "contract" between different languages (lets say JavaScript and C#), but to skip the "communication" part of the gRPC because we don't need http/2 what's so ever.
I googled a lot but seems there is no such project exists. Now I am thinking of making my own by extending the grpc-dotnet project(perhaps with T4 template) , but before start I just need some/any advice/help/information. So here are my questions:
Is there are any project/library doing things similar to what I said above which I don't know yet?
Does grpc-dotnet have any kind of extendibility that allows me to generate the desired C# types without compiling the proto buffs(Can I get the compiled data structure if there are any)
Is it feasible, in terms of dev cost, difficulty etc.
Any other advise to put to the right path?
Thank you very much, any comment/answer would be much appreciated!