Tag: tuples

使用Newtonsoft将JSON数组数组反序列化为List of Tuples

我从在线服务提供商处收到的数据如下: { name: “test data”, data: [ [ “2017-05-31”, 2388.33 ], [ “2017-04-30”, 2358.84 ], [ “2017-03-31”, 2366.82 ], [ “2017-02-28”, 2329.91 ] ], } 我想将它解析成一个看起来像这样的对象: public class TestData { public string Name; public List<Tuple> Data; } 我唯一能找到的是如何将一组对象解析成一个tulples列表,例如: Json.NET反序列化其他类型中的Tuple 不起作用? 有没有办法编写一个可以处理这个问题的自定义转换器?