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