public static void Test_ZValue_02() { Test_ZValue_Class_02 zvalue = new Test_ZValue_Class_02 { value1 = new ZString("toto"), value2 = new ZStringArray(new string[] { "toto", "tata", "tutu", "titi" }), value3 = new ZInt(123) }; Trace.WriteLine("zvalue value1 {0} value2 {1} value3 {2}", zvalue.value1, zvalue.value2, zvalue.value3); BsonDocument document = zvalue.ToBsonDocument(); Trace.WriteLine("zvalue.ToBsonDocument {0}", document.ToJson()); Test_ZValue_Class_02 zvalue2 = BsonSerializer.Deserialize <Test_ZValue_Class_02>(document); Trace.WriteLine("zvalue2 value1 {0} value2 {1} value3 {2}", zvalue2.value1, zvalue2.value2, zvalue2.value3); }
public static void Test_ZValue_02() { Test_ZValue_Class_02 zvalue = new Test_ZValue_Class_02 { value1 = new ZString("toto"), value2 = new ZStringArray(new string[] { "toto", "tata", "tutu", "titi" }), value3 = new ZInt(123) }; Trace.WriteLine("zvalue value1 {0} value2 {1} value3 {2}", zvalue.value1, zvalue.value2, zvalue.value3); BsonDocument document = zvalue.ToBsonDocument(); Trace.WriteLine("zvalue.ToBsonDocument {0}", document.ToJson()); Test_ZValue_Class_02 zvalue2 = BsonSerializer.Deserialize<Test_ZValue_Class_02>(document); Trace.WriteLine("zvalue2 value1 {0} value2 {1} value3 {2}", zvalue2.value1, zvalue2.value2, zvalue2.value3); }