コード例 #1
0
        private static Session CreateSession(out Session entitySelected)
        {
            ISessionStorage storage = new PostgresStorage(ConnectionString);
            var             session = new Session(storage).Open();

            entitySelected = storage.GetBySessionId(session.GetSessionId());

            return(session);
        }
コード例 #2
0
        public void get_all_sessions_from_db()
        {
            ISessionStorage storage = new PostgresStorage(ConnectionString);

            CreateSession(out var _);
            CreateSession(out var _);

            storage.GetAll().Count().Should().BeGreaterThan(1);
        }
コード例 #3
0
        private static Session UpdateSession(Session session)
        {
            ISessionStorage storage = new PostgresStorage(ConnectionString);
            var             entity  = storage.GetBySessionId(session.GetSessionId());

            session = new Session(entity.GetSessionId(), entity.GetVersion(), entity.GetSessionTimeout(), entity.GetExpirationDate(), storage);
            session.Update(session.GetSessionId());

            return(storage.GetBySessionId(session.GetSessionId()));
        }