forum

Home / DeveloperSection / Forums / Deserialize JSON string to Dictionary<string,object>

Deserialize JSON string to Dictionary<string,object>

Anonymous User409123-Dec-2013

I have this string:

[{ "processLevel" : "1" , "segments" : [{ "min" : "0", "max" : "600" }] }]

I'm deserializing the object:

object json = jsonSerializer.DeserializeObject(jsonString);

The object looks like:

object[0] = Key: "processLevel", Value: "1"

object[1] = Key: "segments", Value: ...

And trying to create a dictionary:

Dictionary<string, object> dic = json as Dictionary<string, object>;

but dic gets null.

What can be the issue ?


Updated on 23-Dec-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By