Possible Duplicate:
Json.NET (Newtonsoft.Json) - Two 'properties' with same name?
I'm using JSON.NET to deserialize a JSON file into a Dictionary. Now what I'd like to do is have the following line:
JsonConvert.DeserializeObject<IDictionary<string, object>>(text);
throw an exception if there are duplicate entries in the JSON like this:
{
"ExampleText": "Example 1",
"ExampleText": "Example 2",
"ExampleText": "Example 3",
}
The standard JSON.NET behavior is to simply replace the "ExampleText" entry with whichever entry is last in the JSON. Is it possible to have the exception thrown instead?