Using protobuf-net, I wish to generate a .proto file from a type model other than RuntimeTypeModel.Default
:
RuntimeTypeModel myModel = TypeModel.Create();
myModel.Add(typeof(MyClass), true);
...
string myProto = Serializer.GetProto<MyClass>(); // Does not work, as it references RuntimeTypeModel.Default
- How can I generate a .proto file in this case?
- Inferring from the source code of
GetProto()
, should I simply callmyModel.GetSchema(typeof(MyClass))
?
Since no one answered so far:
Calling
myModel.GetSchema(typeof(MyClass))
did work, though I'm not sure this is the correct method.