public HttpResponseMessage Deletemprcommfee(HttpRequestMessage request, [FromBody] int CommFee_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // note that calling the WCF service here will authenticate access to the data MPRCommFee mprcommfee = _MPRPLService.GetMPRCommFee(CommFee_Id); if (mprcommfee != null) { _MPRPLService.DeleteMPRCommFee(CommFee_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No MPR Commission & Fee found under that ID."); } return response; })); }