For the reasons that I still do not understand (see this SO question) multidimensional arrays in CLR do not implement IEnumerable
. So the following doe
The MSDN page for Array includes this:
Important Note: In the .NET Framework version 2.0, the Array class implements the System.Collections.Generic.IList
, System.Collections.Generic.ICollection , and System.Collections.Generic.IEnumerable generic interfaces. The implementations are provided to arrays at run time,
Note the final words in the quote... it appears this generation does not happen for multi-dimensional arrays (so a documentation bug).
But as others have noted, what would T
be? A good case can be made for T[]
(or, these days with LINQ, IEnumerable
).
In the end, if you want to iterate all the array's members just stick with IEnumerable and Cast