gpt4 book ai didi

asp.net - Newtonsoft.json 抛出错误 : Array was not a one-dimensional array

转载 作者:行者123 更新时间:2023-12-02 00:40:43 25 4
gpt4 key购买 nike

尝试序列化对象产品时出现错误。

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序列化一个二维数组

提前致谢。新航

最佳答案

关于asp.net - Newtonsoft.json 抛出错误 : Array was not a one-dimensional array,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2678977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com