title: Ninject with MembershipProvider | RoleProvider
body: <p>I'm using ninject as my IoC and I wrote a role provider as follows:</p>
  
  <pre><code>public class BasicRoleProvider : RoleProvider
  {
      private IAuthenticationService authenticationService;
  
      public BasicRoleProvider(IAuthenticationService authenticationService)
      {
          if (authenticationService == null) throw new ArgumentNullException("authenticationService");
          this.authenticationService = authenticationService;
      }
  
      /* Other methods here */
  }
  </code></pre>
  
  <p>I read that <code>Provider</code> classes get instantiated before ninject gets to inject the instance. How do I go around this? I currently have this ninject code:</p>
  
  <pre><code>Bind&lt;RoleProvider&gt;().To&lt;BasicRoleProvider&gt;().InRequestScope();
  </code></pre>
  
  <p>From this answer <a href="https://stackoverflow.com/questions/4123092/using-ninject-with-membership-provider/4124404#4124404">here</a>.</p>
  
  <p><code>If you mark your dependencies with [Inject] for your properties in your provider class, you can call kernel.Inject(MemberShip.Provider) - this will assign all dependencies to your properties.</code></p>
  
  <p>I do not understand this.</p>