public ActionResult <string> Delete(int id) { if (_catRepo.DeleteCat(id)) { return(Ok("success")); } return(NotFound("No Cat to delete")); }
public IActionResult Delete(Animals model) { if (ModelState.Count > 0) { var catToDelete = catRepository.GetCats().Find(x => x.Id == model.Id); catRepository.DeleteCat(catToDelete); } return(View(model)); }
public void RemoveCat(string name) { catsContext.DeleteCat(name); }