嘗試序列化對象產品時出現錯誤。Newtonsoft.json拋出錯誤:數組不是一維數組
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Price = 3.99M;
product.Sizes = new string[3,2] { {"Small","40"}, {"Medium","44"}, {"Large","50"} };
string json = JsonConvert.SerializeObject(product);//this line is throwing an error
Array was not a one-dimensional array
有沒有什麼辦法來序列二維陣列Newtonsoft.json
在此先感謝。 SIA
非常感謝國王! 自從過去24小時以來,我一直在努力完成這項工作 – SIA 2010-04-21 11:15:54