사용자 정의 RoleProvider를 구현 중이며 Ninject를 사용하고자하지만 매개 변수없는 생성자 문제가 있습니다. 이것에 대한 주사하는 방법에 대한 모든 생각 ??매개 변수가없는 생성자가있는 Ninject 및 Provider 모델
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);
}
}
이 게시물이 당신을 관심을 끌지 수도 있습니다 : http://blog.ploeh.dk/2011/04/27/ProviderIsNotAPattern.aspx – Steven
그레이트 포스트, 그래서 기본적으로 내 자신의 인터페이스와 구현 롤백해야하고 공급자 XML을 문질러 공급자로서의 web.config는 절름발이입니다. 다시 도면 보드로 돌아 가기 LOL – CrazyCoderz