示例#1
0
        public void DeleteChatRoom(DeleteFriendRequest room)
        {
            ChatRoom     c   = _chatRoomRepository.GetById(room.RoomId);
            UserChatRoom cr1 = _userChatRoomRepository.GetUserChatRoomByFK(room.UserId, room.RoomId);

            _userChatRoomRepository.Delete(cr1);
            c.NumOfMember--;
            if (c.NumOfMember == 0)
            {
                _chatRoomRepository.Delete(c);
            }
            else
            {
                _chatRoomRepository.Update(c);
            }
        }