public ActionResult SaveEdited(ProjectInformations projectInformations) { var projectInformationsInDb = _context.ProjectInformations.Single(x => x.Id == projectInformations.Id); projectInformationsInDb.Name = projectInformations.Name; _context.SaveChanges(); return(RedirectToAction("Index", "Projects")); }
public ActionResult SaveNew(ProjectInformations projectInformations) { if (!ModelState.IsValid) { return(View("New")); } _context.ProjectInformations.Add(projectInformations); _context.SaveChanges(); return(RedirectToAction("Index", "Projects")); }