Esempio n. 1
0
        public override ISession GetSession(object key)
        {
            if (parentTransactionScope != null)
            {
                return(parentTransactionScope.GetSession(new KeyHolder(key)));
            }

            ISession session = null;

            if (parentSimpleScope != null)
            {
                session = parentSimpleScope.GetSession(new KeyHolder(key));
            }

            session = session != null ? session : base.GetSession(key);

            return(session);
        }
Esempio n. 2
0
        /// <summary>
        /// This method should return the session instance associated with the key.
        /// </summary>
        /// <param name="key">an object instance</param>
        /// <returns>
        /// the session instance or null if none was found
        /// </returns>
        public override ISession GetSession(object key)
        {
            if (parentTransactionScope != null)
            {
                return(parentTransactionScope.GetSession(new KeyHolder(key, connection.ConnectionString, connection.GetHashCode())));
            }

            ISession session = null;

            if (parentSimpleScope != null)
            {
                session = parentSimpleScope.GetSession(new KeyHolder(key, connection.ConnectionString, connection.GetHashCode()));
            }

            session = session ?? base.GetSession(key);

            return(session);
        }