【发布时间】:2021-07-07 01:33:00
【问题描述】:
.Net
我的 protobuf 文件:
message Result{
repeated ListOfStrings lists = 1;
}
message ListOfStrings {
repeated string strings = 1;
}
我有一个具有此属性的类:
public List<List<string>> ListOfLists { get; set; }
Protobuf 编译器生成 RepeatedField 集合,当我尝试将此集合传递给 ListOfLists.AddRange() 时,我收到此错误:
cannot convert from 'Google.ProtobufCollections.RepeatedField<gRPC.ListOfStrings>' to 'System.Collection.Generic.IEnumerable<System.Collections.Generic.List<string>>
如何处理?
【问题讨论】:
标签: .net protocol-buffers grpc protobuf-net protobuf-csharp-port