Example #1
0
 public ActionResult <PetType> Get([FromQuery] Filter filter)
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, "could not get pet types"));
     }
 }
 public ActionResult <IEnumerable <PetType> > Get([FromQuery] Filter filter)
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes(filter)));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Example #3
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception e)
     {
         return(StatusCode(500, "Id must be greater than 0"));
     }
 }
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(_petTypeService.GetPetTypes());
     }
     catch (Exception)
     {
         return(StatusCode(500, "Smth Went Wront"));
     }
 }
Example #5
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception)
     {
         return(StatusCode(500,
                           "wrong...."));
     }
 }
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception)
     {
         return(StatusCode(500,
                           "Hmm yes, I can sense something is wrong... Not gonna tell you what tho, you'll have to figure it out."));
     }
 }
 public ActionResult <FilteredList <PetType> > GetPetTypes([FromQuery] Filter filter)
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes(filter)));
     }
     catch (InvalidDataException e)
     {
         return(BadRequest("Something went wrong with your request\n" + e.Message));
     }
     catch (KeyNotFoundException e)
     {
         return(NotFound("Could not find requested petType\n" + e.Message));
     }
     catch (DataBaseException e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Example #8
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     return(Ok(_petTypeService.GetPetTypes()));
 }