private void UpdateUserCommonProperties(User user, BasicAccountInfoViewModel model) { user.AvatarUrl = model.AvatarUrl; user.Bio = model.Bio; user.Email = model.Email; user.FirstName = model.FirstName; user.LastName = model.LastName; }
public IdentityResult Update(BasicAccountInfoViewModel model, string userId) { var user = this.ById(userId); this.UpdateUserCommonProperties(user, model); var result = this.manager.Update(user); return result; }
public IdentityResult Update(BasicAccountInfoViewModel model, string userId) { var user = this.ById(userId); this.UpdateUserCommonProperties(user, model); var result = this.manager.Update(user); return(result); }
public ActionResult Edit(BasicAccountInfoViewModel model) { // Todo check if model.Id and current userId match or if admin if (!this.ModelState.IsValid) { this.TempData["error"] = "Invalid profile data, the profile wasn't updated"; } else { var result = this.users.Update(model, this.UserId); } return(this.PartialView("DisplayTemplates/BasicAccountInfoViewModel", model)); }
public ActionResult Edit(BasicAccountInfoViewModel model) { // Todo check if model.Id and current userId match or if admin if (!this.ModelState.IsValid) { this.TempData["error"] = "Invalid profile data, the profile wasn't updated"; } else { var result = this.users.Update(model, this.UserId); } return this.PartialView("DisplayTemplates/BasicAccountInfoViewModel", model); }