public ActionResult Edit(Task task) { if (ModelState.IsValid) { db.Entry(task).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(task); }
public ActionResult Create(Task task) { if (ModelState.IsValid) { db.Tasks.Add(task); db.SaveChanges(); return RedirectToAction("Index"); } return View(task); }