gRPC 导入已经存在的数据 类 C#
gRPC import already existing data classes C#
我尝试将现有数据 classes 与 gRPC 一起使用
例如我有以下数据 class:
public class Data
{
public int test;
}
如何在我的原型文件中使用它?
service Test{
rpc GetTest (Request) returns (Response);
}
message Request{
int32 id=1;
Test test = 2 ?
}
message Response{
int32 id=1;
}
这是不可能的。您只能在 proto Messages 中使用其他 proto Messages。您将需要以 protobuf 形式重新定义本机数据 类。
我尝试将现有数据 classes 与 gRPC 一起使用 例如我有以下数据 class:
public class Data
{
public int test;
}
如何在我的原型文件中使用它?
service Test{
rpc GetTest (Request) returns (Response);
}
message Request{
int32 id=1;
Test test = 2 ?
}
message Response{
int32 id=1;
}
这是不可能的。您只能在 proto Messages 中使用其他 proto Messages。您将需要以 protobuf 形式重新定义本机数据 类。