This project has moved and is read-only. For the latest updates, please go here.

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

Feb 14, 2012 at 1:45 PM

I have an object:


public class Foo
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 3: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 3:18 PM

Actually, I figured it out: