Esempio n. 1
0
        public void TestAutoCopyJobj()
        {
            var model1 = new TestModel2 {
                Age = 10, Name = "sadfasd", Page = 123333333333333333, Man = false
            };
            var json    = @"{""age"":9,""name"":""json数据"",""man"":true}";
            var josnObj = JObject.Parse(json);
            var result  = model1.JsonCopy(josnObj, StringFormatEnum.Up);

            Console.WriteLine($"测试结果:{result.ToString()}");
            Assert.True(!result.ToString().Contains(" "));
        }