Newtonsoft
Newtonsoft 工具包
天空下的读白
这个作者很懒,什么都没留下…
展开
-
利用 Newtonsoft 来为类数组 统计数据
var jsonStr = "[{\"typeid\":2,\"count\":1},{\"typeid\":-99,\"count\":0}]"; var data = JArray.Parse(jsonStr); int count = data.Aggregate(0, (current, s) => current +=(int)s["count"]); count为1原创 2021-06-17 10:09:24 · 126 阅读 · 0 评论 -
Unable to cast object of type ‘Newtonsoft.Json.Linq.JArray‘ to type ‘Newtonsoft.Json.Linq.JObject‘.
在使用Newtonsoft.Json转换数组原创 2021-04-13 14:02:44 · 5774 阅读 · 0 评论