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

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

            transaction = JsonSerializer.Deserialize <object>(json);
        }
Exemple #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);
        }