Created
November 14, 2012 14:26
-
-
Save davunderscorei/4072398 to your computer and use it in GitHub Desktop.
protobuf-net multiple inheritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in order to do this | |
[ProtoContract] | |
public class Base | |
{ | |
[ProtoMember(1)] | |
public int Value { get;set;} | |
} | |
[ProtoContract] | |
public class Derived : Base {} | |
//you have to do this? | |
[ProtoContract] | |
[ProtoInclude(123, typeof(Derived)] | |
public class Base | |
{ | |
[ProtoMember(1)] | |
public int Value { get;set;} | |
} | |
[ProtoContract] | |
public class Derived : Base {} | |
//but how do you handle | |
[ProtoContract] | |
public class DerivedFromDerived : Derived {} | |
//? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No way.
ProtoBuf.ProtoException: 'A type can only participate in one inheritance hierarchy'