我正在实现一个自定义 RoleProvider 并想使用 Ninject 但是我面临一个无参数构造函数问题。关于如何为此注入的任何想法?
public class EFRoleProvider:RoleProvider
{
private readonly IRepository _repository;
// I want to INJECT this GOO here!
public EFRoleProvider()
{
IContextFactory contextFactory = new DbContextFactory<myEntities>();
_repository = new RepositoryBase(contextFactory);
}
}