Domanda

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.

È stato utile?

Soluzione

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

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top