コード例 #1
0
        private static void DebugSerializers()
        {
            IEnumerable <MerchantDTO> merchants = MerchantBuilder.BuildMerchants(2);

            // Mind that serialized strings will be different due to differences among frameworks
            ISerializer <IEnumerable <Merchant> > newtonsoft = new NewtonsoftSerializer <IEnumerable <Merchant> >();
            string jsonNewtonsoft = newtonsoft.Serialize(merchants);

            ISerializer <IEnumerable <Merchant> > ss = new ServiceStackSerializer <IEnumerable <Merchant> >();
            string jsonSS = ss.Serialize(merchants);

            ISerializer <IEnumerable <Merchant> > netjson = new NetJSONSerializer <IEnumerable <Merchant> >();
            string jsonNetjson = netjson.Serialize(merchants);

            ISerializer <IEnumerable <Merchant> > jil = new JilSerializer <IEnumerable <Merchant> >();
            string jsonJil = jil.Serialize(merchants);

            ISerializer <IEnumerable <Merchant> > utf8 = new Utf8JsonSerializer <IEnumerable <Merchant> >();
            string jsonUtf8 = utf8.Serialize(merchants);
        }
コード例 #2
0
 public void Utf8Json_Small_List()
 {
     ISerializer <IEnumerable <Merchant> > jilSerializer = new Utf8JsonSerializer <IEnumerable <Merchant> >();
     string json = jilSerializer.Serialize(smallList);
     IEnumerable <Merchant> list = jilSerializer.Deserialize(json);
 }