public bool Delete(int id) { var existing = db.Animals.FirstOrDefault(a => a.ID == id); if (existing == null) { return(false); } db.Remove(existing); db.SaveChanges(); return(true); }
public ActionResult Create(Animal animal) { if (ModelState.IsValid) { db.Animals.Add(animal); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(animal)); }
public void Remove(Species species) { _context.Species.Remove(species); _context.SaveChanges(); }
public void Remove(Reservation reservation) { _context.Reservations.Remove(reservation); _context.SaveChanges(); }
public void Remove(User user) { _context.Users.Remove(user); _context.SaveChanges(); }
public void Remove(Animal animal) { _context.Animals.Remove(animal); _context.SaveChanges(); }
public Animals Insert(Animals obj) { db.Animal.Add(obj); db.SaveChanges(); return(obj); }