public HttpResponseMessage Deleteborrowing(HttpRequestMessage request, [FromBody] int borrowingId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data Borrowings borrowing = _IFRSDataService.GetBorrowings(borrowingId); if (borrowing != null) { _IFRSDataService.DeleteBorrowings(borrowingId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No borrowing found under that ID."); } return response; })); }