public void JSON_SerializeMarshall() { CommonShared.Something s = new CommonShared.Something { Name = "something", DateOfBirth = DateTime.Now }; global::Core.Serialization.JSON.System.Text.Json.Simple.JSON json = null; json = new global::Core.Serialization.JSON.System.Text.Json.Simple.JSON(); string json_text = json.SerializeMarshall <CommonShared.Something>(s); return; }
public void XML_Serialize() { CommonShared.Something s = new CommonShared.Something { Name = "something", DateOfBirth = DateTime.Now }; global::Core.Serialization.XML.System.Runtime.Serialization.XML xml = null; xml = new global::Core.Serialization.XML.System.Runtime.Serialization.XML(); string xml_text = xml.SerializeMarshall <CommonShared.Something>(s); return; }
public void JSON_DeserializeUnmarshall() { string json_text = null; global::Core.Serialization.JSON.System.Text.Json.Simple.JSON json = null; foreach (string f in Tests_JSON_DeserializationFromFiles.files) { json_text = global::System.IO.File.ReadAllText(f); } json = new global::Core.Serialization.JSON.System.Text.Json.Simple.JSON(); CommonShared.Something s = json.InferDeduceSchema(json_text); return; }
public void JSON_DeserializeUnmarshall() { string json_text = @" { ""Name"":""something"", ""DateOfBirth"":""2021-10-06T18:07:06.901969+02:00"" } "; global::Core.Serialization.JSON.System.Text.Json.Simple.JSON json = null; json = new global::Core.Serialization.JSON.System.Text.Json.Simple.JSON(); CommonShared.Something s = json.DeserializeUnmarshall <CommonShared.Something>(json_text); return; }
public void XML_Deserialize() { string xml_text = @"<?xml version=""1.0"" encoding=""UTF-8""?> <Something> <DateOfBirth>2021-10-06T18:07:06.901969+02:00</DateOfBirth> <Name>something</Name> </Something> "; global::Core.Serialization.XML.System.Xml.Serialization.XML xml = null; xml = new global::Core.Serialization.XML.System.Xml.Serialization.XML(); CommonShared.Something s = xml.DeserializeUnmarshall <CommonShared.Something>(xml_text); return; }
public void XML_Deserialize() { string xml_text = @" <Something xmlns=""http://schemas.datacontract.org/2004/07/Tests.CommonShared"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" > <DateOfBirth>2021-10-06T18:07:06.901969+02:00</DateOfBirth> <Name>something</Name> </Something> "; global::Core.Serialization.XML.System.Runtime.Serialization.XML xml = null; xml = new global::Core.Serialization.XML.System.Runtime.Serialization.XML(); CommonShared.Something s = xml.DeserializeUnmarshall <CommonShared.Something>(xml_text); return; }
public void JSON_DeserializeUnmarshall() { string json_text = @" { ""Name"":""something"" } "; // https://github.com/kevin-montrose/Jil/blob/master/Jil/DateTimeFormat.cs // ""DateOfBirth"":"""" // ""DateOfBirth"":""null"" // ""DateOfBirth"":""2021-10-06T18:07:06.901969+02:00"" // ""DateOfBirth"":""2021-10-06T18:07:06Z"" global::Core.Serialization.JSON.Jil.JSON json = null; json = new global::Core.Serialization.JSON.Jil.JSON(); CommonShared.Something s = json.DeserializeUnmarshall <CommonShared.Something>(json_text); return; }