示例#1
0
        internal static bool TestCase()
        {
            NoConstructorSon value = new NoConstructorSon {
                Value = 1
            };
            string json = AutoCSer.JsonSerializer.Serialize(value);

            AutoCSer.Json.DeSerializeConfig parseConfig = new AutoCSer.Json.DeSerializeConfig {
                Constructor = checkConstructor
            };
            NoConstructor newValue = AutoCSer.JsonDeSerializer.DeSerialize <NoConstructor>(json, parseConfig);

            return(newValue != null && newValue.Value == 1);
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine(@"http://www.AutoCSer.com/Serialize/Json.html
");
            Console.WriteLine(PublicInstanceField.TestCase());
            Console.WriteLine(AnonymousType.TestCase());
            Console.WriteLine(MemberMap.TestCase());
            Console.WriteLine(MemberMapValue.TestCase());
            Console.WriteLine(IgnoreMember.TestCase());
            Console.WriteLine(SerializeIgnoreMember.TestCase());
            Console.WriteLine(ParseIgnoreMember.TestCase());
            Console.WriteLine(CustomClass.TestCase());
            Console.WriteLine(CustomStruct.TestCase());
            Console.WriteLine(BaseType.TestCase());
            Console.WriteLine(NoConstructor.TestCase());
            Console.WriteLine(SerializeNode.TestCase());
            Console.WriteLine("Over");
            Console.ReadKey();
        }