Esempio n. 1
0
 public ActionResult <bool> DeletePet(int petId)
 {
     try
     {
         return(Ok(_petService.DeletePet(petId)));
     }
     catch (NotFoundException ex)
     {
         return(NotFound(ex.Message));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, $"Something happend: {ex.Message}"));
     }
 }
Esempio n. 2
0
 public IActionResult DeletePet(int id)
 {
     _petServices.DeletePet(id);
     return(NoContent());
 }