Example #1
0
        public void Test()
        {
            Student2 student = new Student2()
            {
                Code     = 1,
                Age      = 23,
                ComeIn   = DateTime.Now,
                UserName = "******",
                Scores   = new List <StudentScore2>()
                {
                    new StudentScore2 {
                        Code = 1, Score = 34.3m, Course = "语言"
                    },
                    new StudentScore2 {
                        Code = 1, Score = 50.4m, Course = "化学"
                    },
                    new StudentScore2 {
                        Code = 1, Course = ""
                    },
                }
            };


            string  temp     = SerializeHelper.ToXml3(student);
            Student student2 = SerializeHelper.FromXml <Student>(temp);
        }
        public void Test()
        {
            Student2 student = new Student2()
            {
                Code = 1,
                Age = 23,
                ComeIn = DateTime.Now,
                UserName = "******",
                Scores = new List<StudentScore2>()
                {
                    new StudentScore2{ Code=1, Score=34.3m, Course="语言"},
                    new StudentScore2{ Code=1, Score=50.4m, Course="化学"},
                    new StudentScore2{ Code=1,Course=""},
                }
            };

            string temp = SerializeHelper.ToXml3(student);
            Student student2 = SerializeHelper.FromXml<Student>(temp);
        }