【C#】Newtonsoft.Json 中 JArray 添加数组报错:Could not determine JSON object type for type 'xxx'
有时我们临时需要一个JSON字符串,直接拼接肯定不是好方法,但又懒得去定义一个类,这是用JObject就会非常的方便。但是在JObject中添加数组却经常被坑。Listnames=newList{"Tom","Jerry"};JArrayarray=newJArray(names);JObjectobj=newJObject(){{"names",array}};Console.WriteLine