-Fixed serializer handling of comments in JSON

This commit is contained in:
JamesNK
2009-05-31 12:10:54 +00:00
parent fec0ec5a1d
commit d160b9f587
4 changed files with 184 additions and 124 deletions
@@ -426,5 +426,33 @@ Parameter name: arrayIndex")]
""title"": null
}", output);
}
[Test]
public void Example()
{
string json = @"{
""Name"": ""Apple"",
""Expiry"": new Date(1230422400000),
""Price"": 3.99,
""Sizes"": [
""Small"",
""Medium"",
""Large""
]
}";
JObject o = JObject.Parse(json);
string name = (string)o["Name"];
// Apple
JArray sizes = (JArray)o["Sizes"];
string smallest = (string)sizes[0];
// Small
Console.WriteLine(name);
Console.WriteLine(smallest);
}
}
}