/// <summary> /// Enables the chat with given name. /// </summary> /// <param name="chatName"> /// The chat name. /// </param> public void EnabledChat(string chatName) { DisabledChat chat = this.disabledChatRepository.GetAll() .FirstOrDefault(c => string.Compare(c.Name, chatName, StringComparison.OrdinalIgnoreCase) == 0); if (chat != null) { this.disabledChatRepository.Delete(chat); } if (this.disabledChats.Contains(chatName)) { this.disabledChats.Remove(chatName); } }
/// <summary> /// Disables the chat with given name. /// </summary> /// <param name="chatName"> /// The chat name. /// </param> public void DisableChat(string chatName) { DisabledChat chat = this.disabledChatRepository.GetAll() .FirstOrDefault(c => string.Compare(c.Name, chatName, StringComparison.OrdinalIgnoreCase) == 0); if (chat == null) { this.disabledChatRepository.Create(new DisabledChat { Name = chatName }); } if (!this.disabledChats.Contains(chatName)) { this.disabledChats.Add(chatName); } }