Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 自定义列表到数组的数组_C#_Json - Fatal编程技术网

C# 自定义列表到数组的数组

C# 自定义列表到数组的数组,c#,json,C#,Json,我需要你的帮助以最有效的方式解决这个问题 我有一个自定义对象列表 var customList = new List<Custom>(); public class Custom { public DateTime Date {get;set;} public double Value {get;set;} } 使用Linq怎么样: var arr = customList.Select(x => new object[] { x.Date, x.Value }).T

我需要你的帮助以最有效的方式解决这个问题

我有一个自定义对象列表

var customList = new List<Custom>();
public class Custom
{
  public DateTime Date {get;set;}
  public double Value {get;set;}
}
使用Linq怎么样:

var arr = customList.Select(x => new object[] { x.Date, x.Value }).ToArray();
使用Linq怎么样:

var arr = customList.Select(x => new object[] { x.Date, x.Value }).ToArray();
@“最有效的方法”是让别人为你编码。你没读那部分吗-p@diiN_“最有效的方法”是让别人为你编写代码。你没读那部分吗-p