public void StartConversation() { foreach (var sessionFactory in getSessionFactories()) { var localFactory = sessionFactory; NHibernateSessionProvider.Bind(new Lazy <ISession>(() => beginSession(localFactory)), sessionFactory); } }
public void EndContext() { foreach (var sessionfactory in getSessionFactories()) { var session = NHibernateSessionProvider.UnBind(sessionfactory); if (session == null) { continue; } endSession(session, false); } }