I am using property injection in my custom role provider like so:
public class MyRoleProvider : RoleProvider
{
[Inject]
public IRoleRepository RoleRepository { get; set; }
...
}
My ninject module:
public class MyNinjectModule : NinjectModule
{
public override void Load()
{
Bind<IRoleRepository>().To<RoleRepository>();
}
}
But when I try to use the RoleRepository property from within MyRoleProvider it is always null. Why isn't ninject injecting a RoleRepository instance into the property?