public IActionResult GetById([FromRoute] int id) { try { return(Ok(_departmentData.GetById(id))); } catch (Exception ex) { return(Problem(ex.Message, nameof(GetById), StatusCodes.Status500InternalServerError, "Fail getting the department.")); } }