我正在尝试从我的 c# 类为一些外部合作者生成 protobuf 文件。问题是:我有很多可以为空的值(int?,double?)
但是当我这样做时:
string protoOutput = Serializer.GetProto<Test>();
与班级
[ProtoContract]
public class Test
{
[ProtoMember(1)]
public int? TEST { get; set; }
[ProtoMember(2)]
public DateTime SDF { get; set; }
}
原型序列化器输出是:
syntax = "proto3";
import "google/protobuf/timestamp.proto";
message Test {
int32 TEST = 1;
.google.protobuf.Timestamp SDF = 2;
}
我如何配置序列化程序以获得:
google.protobuf.Int32Value
对于我的诠释?财产
提前致谢