I get the json from server, add JObject to the JArray. I want to set a name to that json. I do not know how to do it.
foreach(var i = 0; i < 2; i++)
{
var array = new JArray();
var jsonFromServer = GetDataFromServer();
var strAsJson = JsonConvert.DeserializeObject<JObject>(jsonFromServer);
array.Add(strAsJson);
}
I am having now:
[
{...},
{...},
{...}
]
My task is:
[
"0": {...},
"1": {...},
"2": {...}
]
I can not to set the name to the JObject. I can to add the name to the JProperty, but I can not to add JProperty to JArray, because it is not a JObject. I can use the JObject instead and add the json to JsonProperty, but I have to use the JArray.
[ { "0": { ... }}, { "1": {...}}, { "2": {...}} ]though. - Brian Rogers