title: Ninject MVC and static Helper
body: <p>Hello i am having some problems parsing along my database context to my static helper classes.
  For an example my UserHelper class, where i would like to do some lookup to see if the user is an admin.
  Right now i fix they by creating a new Context in my Userhelper, but i would like to use the one instance that is created through ninject. How is this possible?</p>
  
  <pre><code>public static class UserHelper
  {
      private static MetropolOpgavebankenEntities _context;
      public static MetropolOpgavebankenEntities Context
      {
          get
          {
              if (_context == null)
                  _context =
                      new MetropolOpgavebankenEntities(
                          ConfigurationManager.Instance.Configuration.ConnectionString.Value);
              return _context;
          }
      }
  
      public static bool IsAdmin()
      {
          if (!HttpContext.Current.User.Identity.IsAuthenticated)
              return false;
          string username = HttpContext.Current.User.Identity.Name;
          if(Context.Administrators.Any(x =&gt; x.MetropolId.ToLower() == username.ToLower()))
              return true;
          return false;
      }
  }
  </code></pre>
  
  <p>My ninject code</p>
  
  <pre><code>private static void RegisterServices(IKernel kernel)
  {
      kernel.Bind&lt;MetropolOpgavebankenEntities&gt;().ToMethod(c =&gt; new MetropolOpgavebankenEntities(ConfigurationManager.Instance.Configuration.ConnectionString.Value)).InRequestScope();
      kernel.Bind&lt;OpgavebankService&gt;().To&lt;OpgavebankService&gt;();
  }   
  </code></pre>