public void BiserJsonEncode(Biser.JsonEncoder encoder) { encoder.Add("p1", this.p1); encoder.Add("p2", this.p2); encoder.Add("p3", this.p3); encoder.Add("p4", this.p4, (r) => { encoder.Add(r); }); }
static void TestJSONv1() { t1 ot1 = new t1() { p1 = 12, p2 = "dsfg", p3 = new t2 { p1 = DateTime.UtcNow, p2 = "uioziuz" }, p4 = new List <t2> { new t2 { p1 = DateTime.UtcNow.AddDays(12), p2 = "k1" }, new t2 { p1 = DateTime.UtcNow.AddDays(7), p2 = "k2" } } }; var jsonSet = new Biser.JsonSettings { DateFormat = Biser.JsonSettings.DateTimeStyle.ISO }; Biser.JsonEncoder enc = new Biser.JsonEncoder(ot1, jsonSet); string es = enc.GetJSON(Biser.JsonSettings.JsonStringStyle.Prettify); var ot2 = t1.BiserJsonDecode(es, settings: jsonSet); }
public void BiserJsonEncode(Biser.JsonEncoder encoder) { encoder.Add("p1", this.p1); encoder.Add("p2", this.p2); }