public HttpResponseMessage DeleteClosedPeriod(HttpRequestMessage request, [FromBody] int closedPeriodId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data ClosedPeriod closedPeriod = _ExtractionProcessService.GetClosedPeriod(closedPeriodId); if (closedPeriod != null) { _ExtractionProcessService.DeleteClosedPeriod(closedPeriodId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No closedPeriod found under that ID."); } return response; })); }