سؤال

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