title: Access Controller Context/ TempData from business objects
body: <p>I am trying to build a session/tempdata provider that can be swapped. The default provider will work on top of asp.net mvc and it needed to access the .net mvc TempData from the business object class.  I know the tempdata is available through the controller context, but i cant seem to find if that is exposed through HttpContext or something. I dont really want to pass the Controller context as an argument as that would dilute my interface definition since only asp.net based session provider needs this, other (using NoSQL DB etc) doesn't care about Controller Context.</p>
  
  <p>To clarify further, adding little more code here. my ISession interface look like this. and when this code goes to production, the session/tempdata is expected to work using NoSql db. But i also like to have another implementation that works on top of asp.net mvc session/tempdata for my dev testing etc.</p>
  
  <p>public interface ISession</p>
  
  <pre><code>{
      T GetTempData&lt;T&gt;(string key);
  
      void PutTempData&lt;T&gt;(string key, T value);
  
      T GetSessiondata&lt;T&gt;(string key);
  
      void PutSessiondata&lt;T&gt;(string key, T value);
  
  }
  </code></pre>