public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { JArray arr = new JArray(); RWMSDBCategoryInfo info = (RWMSDBCategoryInfo)value; arr.Add(info.Weight); arr.Add(info.Description); arr.WriteTo(writer); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var arr = JArray.Load(reader); var ret = new RWMSDBCategoryInfo(); ret.Weight = (decimal)arr[0]; ret.Description = (string)arr[1]; return(ret); }