public ActionResult <ApiResponse <List <ReasonDto> > > GetAll() { var response = new ApiResponse <List <ReasonDto> >(); try { response.Result = _mapper.Map <List <ReasonDto> >(_reasonRepository.GetAll()); } catch (Exception ex) { response.Result = null; response.Success = false; response.Message = "Internal server error"; _logger.LogError($"Something went wrong: { ex.ToString() }"); return(StatusCode(500, response)); } return(Ok(response)); }
public IEnumerable <Reason> GetAll() { return(reasonRepository.GetAll(false)); }