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