How can I convert this:
For<ISession>().Use(ctx => {
var uow = (INHibernateUnitOfWork)ctx.GetInstance<IUnitOfWork>();
return uow.Session;
});
To Ninject?
I was able to convert this:
For<ISessionSource>().Singleton().Use<NHibernateSessionSource>();
To
Bind<ISessionSource>()
.To<NHibernateSessionSource>()
.InSingletonScope()
And I think I was able to convert this one as well:
For<IUnitOfWork>().HybridHttpOrThreadLocalScoped().Use<NHibernateUnitOfWork>();
To
Bind<IUnitOfWork>().To<NHibernateUnitOfWork>().InThreadScope();
I know that these are not all going to be one-to-one, but could I get some help?
1 Answer