Exemple #1
0
        public bool Logout(string sessionId)
        {
            int rowsDeleted = 0;

            using (UserSessionRepository userSessionRepository = new UserSessionRepository())
            {
                UserSession session = userSessionRepository.Find(x => x.SessionId == sessionId);
                if (session != null)
                {
                    rowsDeleted = userSessionRepository.Delete(session);
                }
                else
                {
                    _loggger.Error(string.Format("Session with session id {0} not found", sessionId));
                    throw new ApplicationException("Session not found.");
                }
            }
            return(rowsDeleted > 0);
        }