예제 #1
0
        public void WriteEmbeddedObject()
        {
            writer.WriteArrayBegin();
            writer.WriteObjectBegin();
            writer.WriteMember("Name", "Paweł");
            writer.WriteMember("Salary", 100);
            writer.WriteMember("Company");
            writer.WriteObjectBegin();
            writer.WriteMember("Name", "CodeTitans");
            writer.WriteMember("Address", "ABCD");
            writer.WriteMember("Value", 10.28437411e2);
            writer.WriteMember("Started", DateTime.Now);
            writer.WriteMemberNull("Account");
            writer.WriteObjectEnd();
            writer.WriteObjectEnd();

            writer.WriteObjectBegin();
            writer.WriteMember("Name", "Aga");
            writer.WriteMember("Salary", 200);
            writer.WriteObjectEnd();

            writer.WriteValue(101);
            writer.WriteValue("New Item");

            writer.WriteArrayEnd();
        }