Inject repository to custom membership provider with Ninject
问题 I'm trying to inject a repository to a custom membership provider with ninject in MVC 3. In MembershipProvider I have tried the following: [Inject] public ICustomerRepository _customerRepository{ get; set; } And [Inject] public TUMembershipProvider(ICustomerRepository customerRepository) { _customerRepository = customerRepository; } In my ninject module i tried the following: Bind<MembershipProvider>().ToConstant(Membership.Provider); None of the above works. When i use(in global.asa) kernel