Users Pricing

forum

Home Forums Deserialize JSON string to Dictionary<string,object> – MindStick

Deserialize JSON string to Dictionary<string,object>

Anonymous User 4496 23 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 ?


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md