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
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