0

こんにちは、次のような配列の配列を作成する方法

  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; }    

    }
4

1 に答える 1

2

あなたが探しているものを理解していれば、これでうまくいくはずです:

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();
于 2012-12-14T18:05:40.127 に答える