I want to convert a Json string to an Object in C#. the string is like this:
{"dealName":"name1","properties":{"a":"1", "b":"2"}}
I define the class like this:
public class DealInfo
{
public string dealName;
public Dictionary<string, string> properties;
}
And I use this code to convert:
DealInfo dl = JsonConvert.Import(typeof(DealInfo), jsonString) as DealInfo;
I found it just converted the dealName field, but the properties count is 0. So, what's the problem? How to fix it? Many thanks!
Please try: