Exemple #1
0
        public HttpResponseMessage DeleteWatchListedLoan(HttpRequestMessage request, [FromBody] int watchListedLoanId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                WatchListedLoan watchListedLoan = _LoanService.GetWatchListedLoan(watchListedLoanId);

                if (watchListedLoan != null)
                {
                    _LoanService.DeleteWatchListedLoan(watchListedLoanId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No watchlistedloan found under that ID.");
                }

                return response;
            }));
        }