I am experiencing difficulties with using MsgPack custom serializer in C#. Say, I have the following class:
public class A
{
public int intA;
public string strA;
public B nestedB;
}
public class B
{
public string strB;
public int intB;
}
I am writing custom deserializer for class A. So my method looks like:
protected override A UnpackFromCore(Unpacker unpacker)
{
int inta;
unpacker.ReadInt32(out inta);
string stra;
unpacker.ReadString(out stra);
B b = new B;
// ??? How to get B from unpacker
unpacker.?????(b);
}
Everything goes fine with primitive types, but how to extract instance of class B from unpacker? Wiki documentation is quite poor, and not to much information on the Internet regarding MessagePack C# implementation. Any kind of help or advice would be greatly appreciated.
Here is what I found so far:
So this is still unclear.
Actually it's not necessary for me to dig deeper in this, so I consider this problem as resolved. Maybe my answer could be helpful for somebody else.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.