Unity and NHibernate

I am looking for the best way to configure Microsoft.Practices.Unity.IUnityContainer to manage nHibernate ISessionFactory lifetime for asp.net application. I would also like unity to introduce my IDataLayer implementation which takes an instance of NHibernate.ISession by calling GetCurrentSession on the managed ISessionFactory.

Please enter the code in your answer :-)

0


a source to share


1 answer


You can also use a direct dependency on ISession and use some NHConversationLifetimeManager. Or take a look at Spring ISession Management (like Java). I think they have already worked on this question (like Hibernate ISession and Dependency Injection Injection).



Sorry, no code!

0


a source







All Articles