I trying to create a serializer like this
var serializer = MsgPack.Serialization.MessagePackSerializer.Create<tickdata>();
It will serialize the class tickdata.
namespace TickDataDefinition
{
public class tickdata
{
public List<data> _data=new List<data>();
public int returncount()
{
return _data.Count;
}
}
public class data
{
enum type { trade, quote }
long time;
double bid1;
double ask1;
double bidsize;
double asksize;
double price;
uint size;
public data(long t,double b,double a,double bs, double ask)
{
time = t;
bid1 = b;
ask1 = a;
bidsize = bs;
asksize = ask;
}
public data(long t,double p,uint s)
{
time = t;
price=p;
size=s;
}
}
}
Strangely this code does not work. The error is "Exception has been thrown by the target of an invocation."