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