Example #1
0
 public ActionResult <PetType> GetByID(int ID)
 {
     try
     {
         PetType type = PetTypeService.GetPetTypeByID(ID);
         if (type != null)
         {
             return(Ok(type));
         }
         return(NotFound());
     }
     catch (Exception ex)
     {
         return(StatusCode(500, $"Error loading pet type with ID: {ID}\nPlease try again..."));
     }
 }