I am doing the following collection initialisation:
Int32[,] v1 = new Int32[2, 2] { { 1, 2 }, { 3, 4 } };
IEnumerable<IEnumerable<Int32>> v2 = new List<List<Int32>> { { 2, 3 }, { 3, 4 } };
On the second line I get the error:
No overload for method 'Add' takes 2 arguments
Is there a way, using the latest C# version, to create an IEnumerable<IEnumerable<Int32>> without adding new List<Int32> for each item inside the main collection?
IEnumerable<IEnumerable<Int32>> v2 = new List<List<Int32>> {
new List<Int32> { 2, 3 },
new List<Int32> { 3, 4 }
};