Exemple #1
0
        /// <summary>
        /// 删除私信会话
        /// </summary>
        /// <param name="sessionId">私信会话Id</param>
        public bool DeleteSession(long sessionId)
        {
            MessageSession messageSession = messageSessionRepository.Get(sessionId);

            if (messageSession != null)
            {
                long otherSessionId = messageSessionRepository.GetSessionsId(messageSession.UserId, messageSession.OtherUserId);
                int  count          = messageSessionRepository.DeleteByEntityId(sessionId);
                if (count > 0)
                {
                    return(messageSessionRepository.DeleteByEntityId(otherSessionId) > 0);
                }
            }
            return(false);
        }
Exemple #2
0
 /// <summary>
 /// 删除私信会话
 /// </summary>
 /// <param name="sessionId">私信会话Id</param>
 public bool DeleteSession(long sessionId)
 {
     return(messageSessionRepository.DeleteByEntityId(sessionId) > 0);
 }