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