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