Ошибка при синтаксическом анализе
{ JObject allJsonData = new JObject(); var tempData = CallRestApi(url, "GET", conn.sessionID, conn.xApiVersionString); var dictKeys = tempData.Properties().Select(p => p.Name).ToList(); if (dictKeys.Contains("total") && dictKeys.Contains("count")) { var tempDataTotal = Int32.Parse(tempData["total"].ToString()); var tempDataCount = Int32.Parse(tempData["count"].ToString()); if (tempDataTotal == tempDataCount) return tempData; List<jtoken> dictDataList = new List<jtoken>(); foreach (var eachDict in tempData["members"]) dictDataList.Add(eachDict); var perPageCount = (tempDataCount < tempDataTotal) ? tempDataCount : tempDataTotal; int loopCount = (int)Math.Ceiling((double)tempDataTotal / (double)tempDataCount); allJsonData = (tempData); for (int i = 1; i < loopCount; i++) { var tempMembers = CallRestApi(url + "?start=" + (i * perPageCount).ToString() + "&count=" + perPageCount.ToString(), "GET", conn.sessionID, conn.xApiVersionString)["members"]; foreach (var myDict in tempMembers) dictDataList.Add(myDict); allJsonData["members"] = (allJsonData["members"].ToString() + "," + tempMembers.ToString()).ToString(); } allJsonData["count"] = tempDataCount; allJsonData["members"] = JObject.Parse(allJsonData["members"].ToString()); }
Что я уже пробовал:
получил следующую ошибку на линии-
allJsonData["members"] = JObject.Parse(allJsonData["members"].ToString());-
error reading jobject from jsonreader.current jsonreader item is not an object.Startarray.path"line 1,position 1"