title: Can I access the ViewData from the HttpContext?
body: <p>Im working with a project that sets variables such as the current user profile object in its authorize action filter, storing them in the <code>ViewData</code> for access by the following action method.</p>
  
  <p>The action method then calls functionality from the repository. I'm trying to find a way to access the <code>ViewData</code> from the repository <strong>WITHOUT modifying the repository's method signature</strong>, and am hoping there is a way I can track back to it via the <code>HttpContext.Current</code> functionality which I can call from the repository.</p>
  
  <p>Can anyone help with this? Just to be clear, the only code that I can modify is within the repository method :(</p>
  
  <pre><code>public class MyController : Controller {
      [MyAuthorize]                   // ViewData items are set here
      public void MyAction(int id)
      {
          new MyRepository().DoSomething(id); // Need to access ViewData items within this repository method and am unable to alter the method signature :(
      }
  }
  </code></pre>