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); }
/// <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); }