public HttpResponseMessage DeleteOpexTimeAllocationMPR(HttpRequestMessage request, [FromBody] int ID) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data OpexTimeAllocationMPR opex = _MPROPEXService.GetOpexTimeAllocationMPR(ID); if (opex != null) { //_MPROPEXService.DeleteActivityBase(ID); _MPROPEXService.DeleteOpexTimeAllocationMPR(ID); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No OpexTimeAllocationMPR found under that ID."); } return response; })); }