public bool IsExistChatWithSamePeaple(List <IClientModel> users, ChatType chatType)
        {
            var allChats = AllChats.Where(c => c.ChatType == chatType).ToList();

            if (allChats.Count() == 0)
            {
                return(false);
            }
            foreach (var chat in allChats)
            {
                foreach (var client in users)
                {
                    if (!chat.IsClientExistInChat(client))
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
 public List <ChatModule> GetAllChatByType(ChatType chatType)
 {
     return(AllChats.Where(c => c.ChatType == chatType).ToList());
 }
 public List <ChatModule> GetAllChatThatClientExist(string name)
 {
     return(AllChats.Where(c => c.IsClientExistInChat(name)).ToList());
 }
        public bool IsExistChatWithName(string groupName)
        {
            var allGroupChats = AllChats.Where(c => c.ChatType == ChatType.Group).ToList();

            return(allGroupChats.Any(g => ((GroupChat)g).GroupName == groupName));
        }
        public GroupChat GetGroupByName(string groupName)
        {
            var allGroupChats = AllChats.Where(c => c.ChatType == ChatType.Group).ToList();

            return((GroupChat)allGroupChats.FirstOrDefault(g => ((GroupChat)g).GroupName == groupName));
        }