Spring.Data.NHibernate.SessionFactoryUtils.OpenSession C# (CSharp) Method

OpenSession() static private method

Open a new Session from the factory.
static private OpenSession ( ISessionFactory sessionFactory, IInterceptor entityInterceptor ) : ISession
sessionFactory ISessionFactory The session factory to create the session with.
entityInterceptor IInterceptor Hibernate entity interceptor, or null if none.
return ISession
        internal static ISession OpenSession(ISessionFactory sessionFactory, IInterceptor entityInterceptor)
        {
            log.Debug("Opening Hibernate Session");
            ISession session = (
                                   (entityInterceptor != null)
                                   ? sessionFactory.OpenSession(entityInterceptor) 
                                   : sessionFactory.OpenSession()
                               );

            return session;
        }