コード例 #1
0
        /// <inheritdoc />
        public ISession GetSession(IDatabase database)
        {
            Fail.IfArgumentNull(database, nameof(database));

            SessionsContainer container = this.GetSessionsContainer();
            ISession          session   = container.GetSession(database);

            return(session);
        }
コード例 #2
0
        /// <inheritdoc />
        public ISession GetSession(IDatabase database)
        {
            Fail.IfArgumentNull(database, nameof(database));

            SessionsContainer container = this.GetSessionsContainer();
            ISession          session   = container.GetSession(database);

            if (session != null && session.IsOpen == false)
            {
                // Session is closed so lets remove it and return null
                container.RemoveSession(session);
                session = null;
            }
            return(session);
        }