public Item(dynamic o, DeserializationSession session, Casing casing, bool memberOfList = false) { Self = o; Session = session; MemberOfList = memberOfList; Casing = casing; }
public static string Convert(dynamic o, Casing casing) { var session = new DeserializationSession(); var item = new Item(o, session, casing); item.EnumerateProperties(); item.Resolve(); return item.Value; }
public static string Stringify(dynamic o, Casing casing = null) { casing = casing ?? new NoCasingChange(); if (o is Result) { if (o.ShouldStringify == false) return o.Value; if (o.Value is string) return "\"" + Escape(o.Value) + "\""; return Stringify(o.Value); } if (IsNull(o)) return "null"; if (IsJsonString(o)) return "\"" + casing.Convert(o) + "\""; if (IsJsonNumeric(o)) return o.ToString(); if (IsBool(o)) return o.ToString().ToLower(); return "\"" + Escape(o) + "\""; }
public DynamicJsonResult(object data) { JsonRequestBehavior = JsonRequestBehavior.AllowGet; Data = data; Casing = new CamelCasing(); }