public ActionResult Create(ExOpto exOpto) { if (ModelState.IsValid) { db.ExOptoes.Add(exOpto); var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(exOpto)); }
public ActionResult Edit(ExOpto exOpto) { if (ModelState.IsValid) { db.Entry(exOpto).State = EntityState.Modified; var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(exOpto)); }