How to force Json.Net to put an integer value into a string field?
- by Earlz
Hello, in using Json.Net I have a class like this
class Foo{
public string name;
public string value;
}
and I have a JSON string that looks like this:
[{"name": "some name","value": "1"}]
The problem with this is that Json.Net detects "1" as being an integer(due to ambiguities with JSON) and will refuse to put it into the string value of Foo
How can I override this behavior so that it will put the string "1" into value?