public HttpResponseMessage DeleteThreshold(HttpRequestMessage request, [FromBody] int thresholdId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SCDThreshold threshold = _ScorecardService.GetSCDThreshold(thresholdId); if (threshold != null) { _ScorecardService.DeleteSCDThreshold(thresholdId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No threshold found under that ID."); } return response; })); }