如何访问Protobuf-net中ProtoMember属性的标签

How to access the tag of ProtoMember properties in Protobuf-net

我正在尝试找到一种方法来访问 proto 成员标签并将其键入为一个集合。 protobuf-net 中有我可以传入 ProtoContract class 并读取 class 中的标签(顺序)和原型成员类型的方法吗?

谢谢

是; TypeModel 具有所有这些配置。 RuntimeTypeModel.Default.Add(yourtype, true) 应该 return 表示 yourtype 的对象 - true 表示应用标准规则(而不是手动配置)。这提供了对成员的访问以及有关该类型的许多其他配置信息。