Esempio n. 1
0
        public HttpResponseMessage UpdateWatchListedLoan(HttpRequestMessage request, [FromBody] WatchListedLoan watchListedLoanModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var watchListedLoan = _LoanService.UpdateWatchListedLoan(watchListedLoanModel);

                return request.CreateResponse <WatchListedLoan>(HttpStatusCode.OK, watchListedLoan);
            }));
        }
Esempio n. 2
0
        public HttpResponseMessage GetWatchListedLoan(HttpRequestMessage request, int watchListedLoanId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                WatchListedLoan watchListedLoan = _LoanService.GetWatchListedLoan(watchListedLoanId);

                // notice no need to create a seperate model object since WatchListedLoan entity will do just fine
                response = request.CreateResponse <WatchListedLoan>(HttpStatusCode.OK, watchListedLoan);

                return response;
            }));
        }
Esempio n. 3
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;
            }));
        }
 public WatchListedLoan UpdateWatchListedLoan(WatchListedLoan watchListedLoan)
 {
     return(Channel.UpdateWatchListedLoan(watchListedLoan));
 }