Вопрос

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