예제 #1
0
        public void Types()
        {
            var model1 = Factory.GetCoreTypesModel();
            var bytes  = QueryStringSerializer.Serialize(model1);
            var model2 = QueryStringSerializer.Deserialize <CoreTypesModel>(bytes);

            Factory.AssertAreEqual(model1, model2);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var serializer = new QueryStringSerializer(
                new QueryStringValueMetadataProvider());

            var albertEinstein =
                new Person
            {
                FirstName = "Albert",
                LastName  = "Einstein",
                BirthDate = new DateTime(1879, 3, 14),
                Height    = 1.75f
            };

            var queryString = serializer.Serialize(albertEinstein);

            Console.WriteLine(queryString);

            Console.ReadLine();
        }
 public string Optimized() => queryStringSerializer.Serialize(entityToSerialize);