1
Vote

tt create class incorrectly when json is dictionary or value type array only.

description

tt create class incorrectly when json is dictionary or value type array only.
e.g.
(1) dictionary
[{"201103180004086698":"tag3"},{"201104070004503759":"tag1"},{"1098":"tag2"}]
(2) array
[2559716940,2573705502]

comments

FelixFang wrote Dec 24, 2011 at 11:44 AM

[{"201103180004086698":"tag3"},{"201104070004503759":"tag1"},{"1098":"tag2"}] is valid??

var dict = new Dictionary<string, string> { {"1", "xxx"}, {"2", "yyy"} };
var list = dict.ToList();
var json = JsonConvert.SerializeObject(list);
==> should be: [{"Key":"1","Value":"xxx"},{"Key":"2","Value":"yyy"}]

waynebaby wrote Dec 27, 2011 at 5:27 AM

Did not find any problem in
"(2) array [2559716940,2573705502]" array transformed into List<double>
Dic part is bug. processing

waynebaby wrote Dec 28, 2011 at 1:20 AM

I rememberd JsonConvert supports dic collection. I am using Dictionary<string,TValue>

wrote Feb 13, 2013 at 10:22 PM