{
"Jhone":[
{
"Key":"Employeename",
"Value":"Jhone"
},
{
"Key":"Address",
"Value":[
{
"Key":"City",
"Value":"Newyork"
},
{
"Key":"Country",
"Value":"USA"
}
]
}
],
"Mohamed":[
{
"Key":"Employeename",
"Value":"Mohamed"
},
{
"Key":"Address",
"Value":[
{
"Key":"City",
"Value":"Delhi"
},
{
"Key":"Country",
"Value":"india"
}
]
}
]
}
This is my JSON format. How to convert in to ExpandoObject in c#? Here is my code as
using System.Dynamic;
using System.Web.Script.Serialization;
using System.IO;
using System.Collections;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
var ictionarys = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(value);
foreach (var item in ictionarys)
{
List<object> itemList = new List<object>();
foreach (var item2 in (ICollection)item.Value)
{
//Here how to code
}
Console.WriteLine(item.Key + "=> " + item.Value);
}