Can somebody advice me how can I implement following injection.
I've got two versions of hibernate sessions. The first have per http request liftime and the second per wcf call life time:
this.Container.RegisterType<ISession>("MVCSession", new PerRequestLifeTimeManager(), new InjectionFactory(c => c.Resolve<ISessionFactory>().OpenSession()));
this.Container.RegisterType<ISession>("WCFSession", new PerWCFCallLifeTimeManager(), new InjectionFactory(c => c.Resolve<ISessionFactory>().OpenSession()));
And I've got a Repository class which depends of ISession
I want MVCSession to be injected in repository if it is used in MVC Controller and WCFSession if repository is used inside WCF service implementation.
Or this is overuse of DI container and I should change my approach?