I have JObject containing dynamic data for example:
{ "person":
{ "name": "myname",
"city":"myCity",
"dynamicUserData":{}
}
}
now based on the city the dynamicUserData should be populated with values from Dictionary. The problem is how to add this dictionary in the dynamicUserData.
code:
var jobject=JObject.Parse(@"{ ""person"": { ""name"": ""myname"", ""city"":""myCity"",""dynamicUserData"":{}}}");
var dic=new Dictionary<string, string>();
foreach (var field in someFieldArray)
{
if (field==something)
{
dic.Add(field,somevalue);
}
}
//now here how can I put these values in dynamicUserData of the JObject?