Remove Quotes from value of a Dictionary<string,string>?

Feb 14, 2012 at 12:45 PM

I have an object:

 

public class Foo
{
[JsonProperty("data")]
public Dictionary<string,string> Data {get;set;}�

}

 

I need the data to look like this:

{"data":{"key1":value1, "key2":value2}}

What is the best way to ensure the values of the Dictionary are not in quotes?

Feb 15, 2012 at 2:14 PM

If you don't want the values in quotes, then you should use the proper type like int. Strings in JSON are quoted.

Feb 15, 2012 at 2:18 PM

Actually, I figured it out:

 

http://stackoverflow.com/questions/9254820/how-to-serialize-a-dictionarystring-string-and-not-surround-the-value-with-quo