protobuf-net: inheritance in C# but not in wire-format
问题 I get that protobuf do not support inheritance, and since I am using protoc-c on another end, I do not want to use any extensions as well. However, I am stuck with a C# model that depends on inheritance: class Header { public int version { get; set; } } class Message : Header { public String message { get; set; } } I attempted to switch the inheritance into encapsulation in the wire format to something like this: [ProtoContract] class Header { [ProtoMember(1)] public int version { get; set; }