title: C# LINQ query on multidimensional array
body: <p>How would I use the following LINQ query correctly? I want to create a one-dimensional array that contains only values that are greater than 5. I can't understand why it can't iterate over this multidimensional array, but if I use <code>foreach</code>, it actually iterates.</p>
  
  <pre><code>// Create an multidimensional array, then just put numbers into it and print the array.  
  int[,] myArr = new int[5,6];
  int rows = myArr.GetLength(0);
  int cols = myArr.GetLength(1);
  for (int i = 0; i &lt; rows; i++)
  {
      for (int k = 0; k &lt; cols; k++)
      {
          myArr[i,k] = i + k;
          Console.Write(myArr[i,k]);
      }
      Console.WriteLine("");
  
  }
  
  var highList = from val in myArr where (val &gt; 5) select val;
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>Could not find an implementation of the query pattern for source type '<code>int[*,*]</code>'.  '<code>Where</code>' not found.  Are you missing a reference or a using directive for '<code>System.Linq</code>'?  </p>
  </blockquote>
  
  <p>I thought this might fix the problem:</p>
  
  <pre><code>public static IEnumerator&lt;int&gt; GetEnumerator(int[,] arr)
  {
      foreach(int i in arr)
      {
          yield return i;
      }
  }
  </code></pre>
  
  <p>But it doesn't implement the iterator.</p>