public Boolean EditBird(Bird bird) { try { _birdContext.Entry(bird).State = EntityState.Modified; _birdContext.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public ActionResult Edit([Bind(Include = "BirdID")] Species collection) { try { if (ModelState.IsValid) { _context.Entry(collection).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(collection)); } catch { return(View()); } }