I have a class that needs to have all the properties of the parent and the grandparent, but I'm not sure how to structure this in protobuf-net.
Seemingly I should just be able to say:
public class Child : Parent {
[ProtoMember(1)]
int childInt;
}
[ProtoInclude(2, typeof(Child))]
public class Parent : GrandParent{
[ProtoMember(1)]
int parentInt;
}
[ProtoInclude(2, typeof(Parent))]
public class GrandParent {
[ProtoMember(1)]
int grandParentInt;
}
This should serialize all the ProtoMember integer members when I try to serialize an instance of the Child class, as far as I know.
Is this the correct way to do serialization inheritance in protobuf-net? Help me Marc!