public ActionResult <PetType> Get(int id) { try { return(_petTypeService.GetById(id)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <PetType> Get(int id) { try { var result = _petTypeService.GetById(id); if (result == null) { return(NotFound()); } return(Ok(result)); } catch (Exception ex) { return(StatusCode(500, $"Process failed!!??:( Exception Message:{ex.Message}")); } }