Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert from JSON object to expando object in c#

I have a JSON object something like

var jsonObject = {"att1" : "val1","att2" : "val2","att3" : "val3","att4" : "val4"}

I need to convert the same into expandoObject

I tried something like

var expConverter = new ExpandoObjectConverter();
dynamic obj = JsonConvert.DeserializeObject<List<ExpandoObject>>(jsonObject, expConverter);

But It is not giving the result.

Can someone help me to get the result ?

Thanks in advance.

like image 504
satish kumar V Avatar asked Mar 16 '15 10:03

satish kumar V


1 Answers

  dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(jsonObject, expConverter);

works just fine...

like image 98
Ch K V S Kumar Avatar answered Sep 20 '22 18:09

Ch K V S Kumar