Esempio n. 1
0
 static void Sample8()
 {
     using (var jr = new ChoJSONReader <DataMapper>("sample8.json"))
     {
         foreach (var x in jr)
         {
             Console.WriteLine(ChoUtility.DumpAsJson(x));
         }
     }
 }
Esempio n. 2
0
 static void Sample11Test()
 {
     using (var parser = new ChoXmlReader("sample11.xml").WithXPath("/members/father")
                         .WithField("id")
                         .WithField("sons")
            )
     {
         foreach (dynamic rec in parser)
         {
             Console.WriteLine(ChoUtility.DumpAsJson(rec.sons));
         }
     }
 }
Esempio n. 3
0
        static void Sample12()
        {
            using (var jr = new ChoJSONReader("sample12.json")
                   )
            {
                foreach (var x1 in jr)
                {
                    foreach (var z1 in x1)
                    {
                        dynamic newObj = new ChoDynamicObject();
                        newObj.name = z1.Key;

                        foreach (var kvp in (ChoDynamicObject)z1.Value)
                        {
                            ((ChoDynamicObject)newObj).AddOrUpdate(kvp.Key, kvp.Value);
                        }

                        Console.WriteLine(ChoUtility.DumpAsJson(newObj));
                    }
                }
            }
        }
Esempio n. 4
0
 public string DumpAsJson()
 {
     return(ChoUtility.DumpAsJson(this));
 }