Having a class type (for example D that was inherited from C, that inherited from B) how to list all class members (including inherited) that are marked with protobuf .net ProtoMember attribute in order from top parent to bottom descendant ( B members, C members, D members)?
Share
Usually the answer would be just to check with reflection, using
GetFields(),GetProperties(), andAttribute.IsDefined. However, in this case it may be more advisable to ask the protobuf-net model what it thinks exists:The advantage of this is that it will work even for custom configurations (attributes are not the only mechanism for configuring protobuf-net)