1
votes

Just a quick question. If I have a binding like so:

Bind<ISession>().ToMethod(context => context.Kernel.Get<ISessionManager>().GetSession()).InRequestScope();

(Assuming that ISessionManager.GetSession() returns SessionFactory.OpenSession())

Do I need to explicitly close the session? or will it automatically dispose itself when Ninject deems it out of scope?

1
I think the answer is here : stackoverflow.com/questions/5243228/…Tomasz Jaskuλa
not a possible, it is a duplicate... couldnt find the initial question you have postedsomemvcperson

1 Answers

2
votes

If ISession implements IDisposable Ninject will call it , And I think it does.

Latest Source code : http://nhibernate.svn.sourceforge.net/viewvc/nhibernate/trunk/nhibernate/src/NHibernate/ISession.cs?revision=5765&view=markup