title: How to get depth of hierarchical data with linq query?
body: <p>I have a list of hierarchical data like this:</p>
  
  <pre><code>var list = new List&lt;Data&gt;(){some data...}
  
  class Data
  {
      public int number;
      public List&lt;Data&gt; info;
  }
  </code></pre>
  
  <p>Note: Data in leaf of tree --><code>info = null</code> </p>
  
  <p><strong>Example:</strong></p>
  
  <p>numbers are <code>number property</code> of Data class</p>
  
  <pre><code>   --1
        --11
     --2
        --21
        --22
        --23
        --24
     --3
        --31
        --32
            --321
            --322
     --4
        --41
        --42
  </code></pre>
  
  <p>How to know max depth of tree with <strong>linq</strong> query(Not Recursive method or for loop ) to list of data?</p>
  
  <p>in this example max level is 3 for 321,322</p>
  
  <p>Thanks.</p>