title: Routing to reflect subdirectory structure in ASP.NET MVC
body: <p>I have a data model for a directory type structure that looks something like this:</p>
  
  <pre><code>Folder:
     String Name
     Folder Parent
     List&lt;File&gt; Files
  
  File
     Folder Parent
     Content
  </code></pre>
  
  <p>Files and folders at the root level would have a null parent. For navigating folders I would like to be able to have urls that look something like:</p>
  
  <pre><code>http://mysite.com/directoryA/directoryB/directoryC/
  </code></pre>
  
  <p>I realize this has a bit of redundancy, but I feel it has better readability, and makes a good deal of sense in this case. Using default routes, that same folder would look like:</p>
  
  <pre><code>http://mysite.com/Folder/directorycID
  </code></pre>
  
  <p>which does not read nearly as nice. Are there any existing patterns that can do this type of routing? The problem with using names instead of ID's is that I would have to trace the entire structure from the root, since names are only guaranteed unique within a parent directory. Is there a route type that can just give the controller a list of directories, and I can sort out the relationships in the controller? It would be a bit more work, but I could deal with that. </p>