Пример #1
0
        public ActionResult EditProfile(UserProfile userProfile)
        {
            if (ModelState.IsValid)
            {
                var user = repository.GetUser(userProfile.UserId);
                user.UserName = userProfile.UserName;
                user.Email = userProfile.Email;
                repository.SaveUser(user);
                return RedirectToAction("Index", "Home");
            }

            return View(userProfile);
        }
Пример #2
0
 public ActionResult EditProfile(int userId)
 {
     var user = repository.GetUser(userId);
     var userProfile = new UserProfile { Email = user.Email, UserName = user.UserName, UserId = CurrentUser.UserId };
     return View(userProfile);
 }