Ejemplo n.º 1
0
        private void HandleAddAdmin(ChatUser user, string[] parts)
        {
            if (parts.Length == 1)
            {
                throw new InvalidOperationException("Who do you want to make an admin?");
            }

            string targetUserName = parts[1];

            ChatUser targetUser = _repository.VerifyUser(targetUserName);

            _chatService.AddAdmin(user, targetUser);

            _notificationService.AddAdmin(targetUser);

            _repository.CommitChanges();
        }