public IHttpActionResult Post(Line line) { IHttpActionResult result = null; LineService service = new LineService(); Line newLine = service.InsertLine(line); if (newLine != null) { result = Created <Line>(Request.RequestUri + newLine.Id.ToString(), newLine); } else { result = NotFound(); } return(result); }