Let’s say I have a Dictionary<string,object> like so:
var foo = new Dictionary<string, object>();
foo["bar"] = new
{
Quux = "bacon",
Quinge = 42
};
foo["baz"] = DateTime.Now;
I expect it the result to the user would be akin to:
{"bar":{"Quux":"bacon","Quinge":42},"baz":"2009-12-02 17:23:00"}
However, it could just as easily be:
[{"Key":"bar","Value":{"Quux":"bacon","Quinge":42}},
{"Key":"baz","Value":"2009-12-02 17:23:00"}]
Which will it be, and if it’s the latter, what do I need to do to ensure that I get the former?
It’s like the first one, although the property names don’t have quotes. Also dates dont get serialized like that, instead you get a call to the Date() javascript function.