Ejemplo n.º 1
0
        public List <FetchAllChatRoomRespond> FetchAllChatRoom(int id)
        {
            List <FetchAllChatRoomRespond> list = new List <FetchAllChatRoomRespond>();
            List <UserChatRoom>            l    = _userChatRoomRepository.GetAllUserChatRoom(id);

            foreach (UserChatRoom i in l)
            {
                ChatRoom c = _chatRoomRepository.GetById(i.ChatRoomId);
                FetchAllChatRoomRespond r = new FetchAllChatRoomRespond {
                    id   = c.Id,
                    Name = c.ChatRoomName
                };
                list.Add(r);
            }
            return(list);
        }
Ejemplo n.º 2
0
        public bool DeleteUser(int id)
        {
            List <UserChatRoom> listUserChatRoom = _userChatRoomRepository.GetAllUserChatRoom(id);

            foreach (UserChatRoom i in listUserChatRoom)
            {
                _userChatRoomRepository.Delete(i);
            }
            List <UserRefreshToken> listRefreshToken = _userRefreshTokenRepository.GetTokenByUID(id);

            foreach (UserRefreshToken i in listRefreshToken)
            {
                _userRefreshTokenRepository.Delete(i);
            }
            _userRepository.Delete(_userRepository.GetById(id));
            return(true);
        }