コード例 #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"));
     }
 }
コード例 #2
0
 public ActionResult <IEnumerable <PetType> > Get([FromQuery] Filter filter)
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes(filter)));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
コード例 #3
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception e)
     {
         return(StatusCode(500, "Id must be greater than 0"));
     }
 }
コード例 #4
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(_petTypeService.GetPetTypes());
     }
     catch (Exception)
     {
         return(StatusCode(500, "Smth Went Wront"));
     }
 }
コード例 #5
0
ファイル: PetTypeController.cs プロジェクト: Nbruunj/petsshop
 public ActionResult <IEnumerable <PetType> > Get()
 {
     try
     {
         return(Ok(_petTypeService.GetPetTypes()));
     }
     catch (Exception)
     {
         return(StatusCode(500,
                           "wrong...."));
     }
 }
コード例 #6
0
 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));
     }
 }
コード例 #8
0
 public ActionResult <IEnumerable <PetType> > Get()
 {
     return(Ok(_petTypeService.GetPetTypes()));
 }