Пример #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);
        }
 public void ServiceStackNative_Long_List()
 {
     ISerializer <IEnumerable <Merchant> > ssSerializer = new ServiceStackSerializer <IEnumerable <Merchant> >();
     string json = ssSerializer.SerializeNative(longList);
     IEnumerable <Merchant> list = ssSerializer.Deserialize(json);
 }
 public void ServiceStack_Small_List()
 {
     ISerializer <IEnumerable <Merchant> > ssSerializer = new ServiceStackSerializer <IEnumerable <Merchant> >();
     string json = ssSerializer.Serialize(smallList);
     IEnumerable <Merchant> list = ssSerializer.Deserialize(json);
 }