public IHttpActionResult DeleteById([FromUri] int id) { if (!ModelState.IsValid) { return(this.Error().InvalidParameters()); } var demographic = _demographicRepository.GetById(id); if (demographic == null) { return(this.NotFound()); } _demographicRepository.Delete(id); return(Ok()); }