Example #1
0
 public ActionResult <string> Delete(int id)
 {
     if (_catRepo.DeleteCat(id))
     {
         return(Ok("success"));
     }
     return(NotFound("No Cat to delete"));
 }
Example #2
0
 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));
 }
Example #3
0
 public void RemoveCat(string name)
 {
     catsContext.DeleteCat(name);
 }