estoy usando ninject como mi COI y me escribió un proveedor de funciones de la siguiente manera:Ninject con MembershipProvider | RoleProvider
public class BasicRoleProvider : RoleProvider
{
private IAuthenticationService authenticationService;
public BasicRoleProvider(IAuthenticationService authenticationService)
{
if (authenticationService == null) throw new ArgumentNullException("authenticationService");
this.authenticationService = authenticationService;
}
/* Other methods here */
}
leí que Provider
clases consiguen una instancia antes ninject llega a inyectar la instancia. ¿Cómo voy alrededor de esto? Actualmente tengo este código de ninject:
Bind<RoleProvider>().To<BasicRoleProvider>().InRequestScope();
De esta respuesta here.
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.
no entiendo esto.
posible duplicado de [Inyectar depósito en proveedor de pertenencia personalizado con Ninject] (http://stackoverflow.com/questions/5596441/inject-repository-to-custom-membership-provider-with-ninject) –