Simply try serialize :
var a = new A { B = new DerrivedFromBase { Count = 2, Name = "Derived" } };
[ProtoContract]
public class A
{
[ProtoMember(1, AsReference = true)]
public Base B { get; set; }
}
[ProtoContract]
[ProtoInclude(2, typeof(DerrivedFromBase))]
public class Base
{
[ProtoMember(1)]
public string Name { get; set; }
}
[ProtoContract]
public class DerrivedFromBase : Base
{
[ProtoMember(3)]
public int Count { get; set; }
}
Original issue reported on code.google.com by bartosz....@gmail.com on 18 Oct 2011 at 10:21
Original issue reported on code.google.com by
bartosz....@gmail.com
on 18 Oct 2011 at 10:21