在使用 protobuf-net 的 C# 中,我想将 protobuf 定义保留在 .proto 文件中。 (它用于生成其他语言的代码,...)
我知道 Google 的 protoc 实现不会在 Java 生成的代码中生成任何 Map。
但是,由于 protobuf-net 支持字典,如果我从 .cs 文件生成 .proto,我想知道它是否也支持从 .proto 到 .cs 文件。
例如,在 .proto 文件中我有:
message KeyValuePair_String_String {
optional string Key = 1;
optional string Value = 2;
}
是否可以将任何参数传递给 protobuf-net C# protogen.exe 编译器,以便它创建字典而不是列表?
谢谢, 瑞
最佳答案
简短的回答是:目前还没有。
关于c# - protobuf-net从.proto文件到.cs文件时是否支持字典? (通过 protogen.exe),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17221107/