public async Task <ActionResult> Edit(UserEditViewModel model)
        {
            var foundUser = await _securityService.GetUserByIdAsync(User.Identity.GetUserId <string>());

            try
            {
                var mappedUser = Mapper.Map(model, foundUser);
                await _securityService.SaveUserAsync(mappedUser);

                return(RedirectToAction("Details"));
            }
            catch (Exception exception)
            {
                //TODO: log here
            }

            return(View(model));
        }
示例#2
0
        public async Task <IHttpActionResult> UpdateUser(UserViewModel model)
        {
            var foundUser = await _securityServiceAsync.GetUserByIdAsync(model.Id);

            var mappedUser = Mapper.Map(model, foundUser);
            await _securityServiceAsync.SaveUserAsync(mappedUser);

            return(Ok());
        }
 public async Task UpdateAsync(User user)
 {
     await _securityServiceAsync.SaveUserAsync(user);
 }