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