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

IsDeferredCloseActive() public static method

Return if deferred close is active for the current thread and the given SessionFactory.
If SessionFactory argument is null.
public static IsDeferredCloseActive ( ISessionFactory sessionFactory ) : bool
sessionFactory ISessionFactory The session factory.
return bool
        public static bool IsDeferredCloseActive(ISessionFactory sessionFactory) 
        {
            if (sessionFactory == null)
            {
                throw new ArgumentNullException("sessionFactory", "No SessionFactory specified");
            }
            IDictionary holderDictionary = LogicalThreadContext.GetData(DeferredCloseHolderDataSlotName) as IDictionary;          
            return (holderDictionary != null && holderDictionary.Contains(sessionFactory));
        }