public ActionResult Create(Project project) { //Create the new project and add into the database if (ModelState.IsValid) { project.Id = db.Projects.Max(i => i.Id + 1); db.Projects.Add(project); db.SaveChanges(); return RedirectToAction("Index"); } return View(project); }
public ActionResult Edit(Project project) { //Save the changes made if (ModelState.IsValid) { db.Entry(project).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(project); }