public async Task <IActionResult> ChangeEmail(UserForChangeEmailDTO model, int id)
        {
            var result = await _authService.ChangeEmailAddressAsync(model, id);

            if (result.Success)
            {
                return(Ok(result.Message));
            }

            return(BadRequest(result.Message));
        }
        public IHttpActionResult ChangeEmail(UserForChangeEmailDTO model, int id)
        {
            var user = UserManager.FindById(id);

            if (user == null || !ModelState.IsValid)
            {
                return(BadRequest("Email Adresi Değiştirilemedi"));
            }
            user.Email = model.Email;
            UserManager.Update(user);
            return(Ok());
        }
        public async Task <IResult> ChangeEmailAddressAsync(UserForChangeEmailDTO userForChangeEmailDto, int id)
        {
            var user = await FindUserByUserIdAsync(id);

            if (!user.Success)
            {
                return(user);
            }

            user.Data.Email = userForChangeEmailDto.Email;
            var result = await UpdateUserAsync(user.Data);

            if (result.Success)
            {
                return(new SuccessResult(Messages.EmailChanged));
            }
            return(new ErrorResult(Messages.Error));
        }