// DELETE api/<controller>/5 public IHttpActionResult Delete(int id) { IHttpActionResult result = null; LineService service = new LineService(); Line line = service.GetLine(id); if (line != null) { service.RemoveLine(id); result = Ok(true); } else { result = NotFound(); } return(result); }