문제

I'm trying to use membershipreboot oss using MEF conventions but having trouble with generics and the string constant.

The example uses ninject.

var config = MembershipRebootConfig.Create();

kernel.Bind<MembershipRebootConfiguration<HierarchicalUserAccount>>().ToConstant(config);
        kernel.Bind<UserAccountService<HierarchicalUserAccount>>().ToSelf();
        kernel.Bind<AuthenticationService<HierarchicalUserAccount>>().To<SamAuthenticationService<HierarchicalUserAccount>>();

kernel.Bind<IUserAccountRepository<HierarchicalUserAccount>>().ToMethod(ctx => new RavenUserAccountRepository("RavenDb"));

This is what i'm trying to achieve.

AuthenticationService<HierarchicalUserAccount> svc = 
                 new SamAuthenticationService<HierarchicalUserAccount>(
                      new UserAccountService<HierarchicalUserAccount>(
                          new RavenUserAccountRepository("RavenDb")));

Any help would be appreciated.

도움이 되었습니까?

해결책

Built it manually and threw it in the container...

I'll come back another day and try to pick it apart.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top