public async Task <IActionResult> GetById(int id) { var result = await _reasonService.GetById(id); var reasons = _mapper.Map <ReasonDTO>(result); return(Ok(reasons)); }
public IActionResult GetById(int id) { try { var entity = _service.GetById(id); return(Ok(_mapper.Map <BL.Reason, Reason>(entity))); } catch (Exception ex) { return(BadRequest($"{ex.Message}")); } }