Multidimensional arrays do not implement IEnumerable<T>, or do they?
问题 For the reasons that I still do not understand (see this SO question) multidimensional arrays in CLR do not implement IEnumerable<T> . So the following does not compile: var m = new int[2,2] {{1, 2}, {3, 4}}; var q = from e in m select e; Then how come that this works just fine in VB.NET ? Sub Main() Dim m(,) As Integer = {{1, 2}, {3, 4}} Dim q = From e In m Select e For Each i In q Console.WriteLine(i) Next End Sub Update: The following code works because the C# compiler replaces the foreach