I'm using ASP.NET MVC 3 with Ninject and NHibernate.
When thinking of DI, i think the one who get the resource also makes sure to close it(In this case Ninject should be responsible)
But I'm not sure how Ninject works when using InRequestScope.
My code is:
Bind<ISession>().ToMethod(context => context.Kernel.Get<ISessionFactory>().OpenSession()).InRequestScope();
I open a session and put it in I InRequestScope, but will Ninject take of closing my ISession when it is out of request scope?