public void AddRegistration(User user, Registration reg) { if (user.Registrations == null) { user.Registrations = new List <Registration>(); } user.Registrations.Add(reg); uDB.Update(user); }
public ActionResult Edit(EditUserModel model) { try { User user = _repository.GetUser(model.UserName); ModelCopier.CopyModel(model, user); _repository.Update(user); return(RedirectToAction("Details", new { id = model.UserName })); } catch (Exception) { ModelState.AddModelError("", "Edit Failure, see inner exception."); } return(View(model)); }