gpt4 book ai didi

c# - protobuf-net 从 .proto 文件到 .cs 文件时是否支持字典? (通过 protogen.exe)

转载 作者:太空宇宙 更新时间:2023-11-03 11:02:22 26 4
gpt4 key购买 nike

在使用 protobuf-net 的 C# 中,我想将我的 protobuf 定义保存在 .proto 文件中。 (它用于为其他语言生成代码,...)

我知道 Google 的 protoc 实现不会在 Java 生成的代码中生成任何 Map。

但是,如果我从 .cs 文件生成 .proto,protobuf-net 支持字典,我想知道它是否也支持从 开始的字典.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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com