title: LINQ query and sub-query enumeration count in C#?
body: <p>suppose I have this query : </p>
  
  <pre><code>  int[] Numbers= new int[5]{5,2,3,4,5};
  
    var query =  from a in Numbers
        where a== Numbers.Max (n =&gt; n) //notice MAX  he should also get his value somehow
        select a;
  
  foreach (var element in query)
    Console.WriteLine (element);
  </code></pre>
  
  <ul>
  <li><p>How many times does <code>Numbers</code> is  <strong>enumerated</strong> when running the <code>foreach</code> ?</p></li>
  <li><p>how can I test it ( I mean , writing a code which tells me the number of iterations)</p></li>
  </ul>