c# - Initializing serialization for derived classes in protobuf -
I am using protobuf, I have intangible class base1.cs and other class ListofItems.cs in which base1 and some other List of properties.
In this way, I initialize the serializer
Private Static Meta Type Actual Model; Static Initserialization () {var model = TypeModel.Create (); Model Add (typef (event message), true); Actualmodel = Model.Add (typef (base1), true); ProtobufSerializer.Models.Add (TypeofItems, Model); }
I have a bunch of stuff that comes from base1.cs and everything works fine. Now I am adding another square base2.cs which is obtained from base 1, how do I make an initial update to include this base2?
Tried down but does not work
Actualmodel = Model.Add (typeof (base1), true). AddSubType (500, typeof (base2));
Thanks!
Comments
Post a Comment