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