title: Building a Tree menu with recursion in MVC4 - which data structure to use?
body: <p>I'm building an application with MVC4 that handles Boxes.  A Box can contain many boxes and may contain a Box.  The menu should look like this: </p>
  
  <pre><code>&gt; Box 1
  &gt; Box 2
     &gt; Box 2.A
     &gt; Box 2.B
     &gt; Box 2.C
        &gt; Box 2.C.1
     &gt; Box 2.D
  &gt; Box 3
  </code></pre>
  
  <p>Right now I have the following: </p>
  
  <pre><code>public object GetTree(Box? box){
  
     foreach (var box in box.Boxes)
     {
         GetTree(box)
         // append menu item with box.name, box.id pair so a link can get generated
     }
  </code></pre>
  
  <p>I'm a little bit stuck though.  The menu will get passed as an object to a client, which will somehow display it as a tree menu of links.  What data structure is most appropriate here?</p>