예제 #1
0
        private static string GetSerializedTransaction()
        {
            var    transaction = Initialize.GetTransaction();
            string json        = JsonSerializer.Serialize(transaction);

            return(json);
        }
예제 #2
0
        private static void SerializeSample()
        {
            var    transaction = Initialize.GetTransaction();
            string json        = JsonSerializer.Serialize(transaction);

            transaction = JsonSerializer.Deserialize <object>(json);
        }
예제 #3
0
        private static void SerializeIdentedJSON()
        {
            List <Order> orders = Initialize.InitOrders();

            var options = new JsonSerializerOptions()
            {
                WriteIndented = true
            };

            string json = JsonSerializer.Serialize(orders, options);

            Console.WriteLine(json);
        }