public HttpResponseMessage DeleteCaption(HttpRequestMessage request, [FromBody] int CaptionId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data Caption caption = _MPRIncomeService.GetCaption(CaptionId); if (caption != null) { _MPRIncomeService.DeleteCaption(CaptionId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No caption found under the captionid."); } return response; })); }