public virtual void UpdateProfile(UpdateProfileContract contract) { var repo = repositories.GetUserRepository(); var userId = Convert.ToInt32(workContext.GetCurrentUserSession().UserId); var user = repo.GetUser(userId); user.Email = contract.Email; user.Firstname = contract.Firstname; user.Lastname = contract.Lastname; repo.UpdateUser(user); repo.Save(); throw new BusinessException(Constants.Message.Sucess.UpdateProfile); }
public Result Put([FromBody] UpdateProfileContract contract) { service.UpdateProfile(contract); return Result.Ok(); }