public IHttpActionResult GetById([FromUri] int id) { if (!ModelState.IsValid) { return(this.Error().InvalidParameters()); } var d = _demographicRepository.GetById(id); if (d == null) { return(NotFound()); } return(Ok(_mapper.Map <DemographicModel>(d))); }