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