public HttpResponseMessage DeleteIncomeProductsTableTreasury(HttpRequestMessage request, [FromBody] int iptTreasuryId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data IncomeProductsTableTreasury ipt = _MPRIncomeService.GetIncomeProductsTableTreasury(iptTreasuryId); if (ipt != null) { _MPRIncomeService.DeleteIncomeProductsTableTreasury(iptTreasuryId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No IncomeProduct table treasury found under the ID."); } return response; })); }