public void InitiateChangeEmailProcess(int userId, string newEmailValue)
        {
            var user = _userManager.GetUserById(userId);

            _confirmationCodeService.DeactivateCodesByType(user, ConfirmationCodeType.EmailChange);

            var newEmail = new Email();

            newEmail.IsActive    = false;
            newEmail.IsConfirmed = false;
            newEmail.User        = user;
            newEmail.Value       = newEmailValue;

            user.AddEmail(newEmail);

            try
            {
                _userManager.UpdateUser();
            }
            catch (DbUpdateException)
            {
                throw new EmailIsAlredyTakenException("Email is alredy taken!");
            }

            _senderService.SendConfirmation(user.Email, ConfirmationCodeType.EmailChange);
        }
        public void InitiateChangeEmailProcess(int userId, string newEmailValue)
        {
            var user = _userManager.GetUserById(userId);

            _confirmationCodeService.DeactivateCodesByType(user, ConfirmationCodeType.EmailChange);

            var newEmail = new Email();

            newEmail.IsActive    = false;
            newEmail.IsConfirmed = false;
            newEmail.User        = user;
            newEmail.Value       = newEmailValue;

            user.AddEmail(newEmail);
            _userManager.UpdateUser();

            _senderService.SendConfirmation(user.Email, ConfirmationCodeType.EmailChange);
        }