public ActionResult Edit(UserViewModel form) { if (!ModelState.IsValid) { return(View(form)); } //Create the mapping between AutomobileDM to CarVM Mapper.CreateMap <UserViewModel, ApplicationUser>(); //Perform the conversion and fetch the destination view model var updateAlumni = Mapper.Map <ApplicationUser>(form); updateAlumni.UpdateDatetime = DateTime.Now; _context.UpdateOneEntity <ApplicationUser>(updateAlumni); //throw new InvalidOperationException(); return(RedirectToAction <AlumniController>(c => c.Index()).WithInfo("Alumni updated!")); }
public ActionResult Save(College input) { _context.UpdateOneEntity <College>(input); return(RedirectToAction <CollegeController>(d => d.Index(input.LanguageId))); }