Exemple #1
0
 public async Task<IdentityResult> UpdateProfile(UserProfileViewModel userProfileViewModel)
 {
     ApplicationUser appUserModel = UserManager.FindById(userProfileViewModel.UserName);
     appUserModel.Email = userProfileViewModel.Email;
     appUserModel.MobileNo = userProfileViewModel.MobileNo;
     appUserModel.UserName = userProfileViewModel.MobileNo;
     IdentityResult result = await UserManager.UpdateAsync(appUserModel);
     return result;
 }
        public async Task<IHttpActionResult> UpdateProfile(UserProfileViewModel userProfileViewModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            IdentityResult result = await _repo.UpdateProfile(userProfileViewModel);
            IHttpActionResult errorResult = GetErrorResult(result);
            if (errorResult != null)
            {
                return errorResult;
            }
            return Ok();
        }