title: How is multi-tenancy done in the Orchard Project
body: <p>I have been stepping through the source code for Orchard CMS to learn how they have tackled Multi-tenancy.</p>
  
  <p><a href="http://orchardproject.net/docs/">OrchardProject</a></p>
  
  <p>Can someone point out the files or areas I should be looking at to understand how the plumbing works for Multi-tenancy in Orchard?</p>
  
  <ul>
  <li>How and where is the domain name deciphered to get the tenant from the DB?</li>
  <li>How is the tenant configuration details maintained throughout the time the user is on the site - sessions?</li>
  </ul>
  
  <p>As a test project, I want to be able to write similar bare-bone code in an ASP.Net MVC application to demonstrate multi-tenancy.</p>
  
  <p>The areas I have looked at:</p>
  
  <ul>
  <li>OnBeginRequest</li>
  <li>Global.cs</li>
  <li>Stater.cs</li>
  </ul>