嗨如何创建一个数组数组,如
EDIT: [[1,"aaaaaa",1],[2,"bbbbbbb",2],[3,"ccccccc",3]]
从列表中
IList<TestList>
public class TestList
{
public int x{ get; set; }
public string Name { get; set; }
public int y{ get; set; }
}
嗨如何创建一个数组数组,如
EDIT: [[1,"aaaaaa",1],[2,"bbbbbbb",2],[3,"ccccccc",3]]
从列表中
IList<TestList>
public class TestList
{
public int x{ get; set; }
public string Name { get; set; }
public int y{ get; set; }
}
如果我了解您在寻找什么,这应该可以解决问题:
IList<TestList> testList;
public class TestList
{
public int x{ get; set; }
public string Name { get; set; }
public int y{ get; set; }
}
var newList = testList.Select(t => new object[] { t.x, t.Name, t.y});
var myArrayOfArrays = newList.ToArray();