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