public ActionResult <List <PetType> > GetFilteredType(string type)
 {
     try
     {
         return(Ok(_petTypeService.GetAllByType(type)));
     }
     catch (Exception)
     {
         return(StatusCode(500, "Smth Went Wrong"));
     }
 }
Example #2
0
        public ActionResult <PetType> GetFilteredPetTypes(string type)
        {
            var petType = _petTypeService.GetAllByType(type);

            try
            {
                return(Ok(petType));
            }
            catch (Exception)
            {
                return(StatusCode(500, "Task failed successfully."));
            }
        }
        public ActionResult <PetType> GetFilteredPetTypes(string type)
        {
            var petType = _petTypeService.GetAllByType(type);

            try
            {
                return(Ok(petType));
            }
            catch (Exception)
            {
                return(StatusCode(500, "Something went horribly wrong during execution. Rename please."));
            }
        }