public HttpResponseMessage DeleteKPITargetMap(HttpRequestMessage request, [FromBody] int kpiTargetMapId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data SCDKPITargetMap kpiTargetMap = _ScorecardService.GetSCDKPITargetMap(kpiTargetMapId); if (kpiTargetMap != null) { _ScorecardService.DeleteSCDKPITargetMap(kpiTargetMapId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No kpiTargetMap found under that ID."); } return response; })); }