Exemplo n.º 1
0
        private static string GetSerializedTransaction()
        {
            var    transaction = Initialize.GetTransaction();
            string json        = JsonSerializer.Serialize(transaction);

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

            transaction = JsonSerializer.Deserialize <object>(json);
        }
Exemplo n.º 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);
        }