public HttpResponseMessage UpdateWatchListedLoan(HttpRequestMessage request, [FromBody] WatchListedLoan watchListedLoanModel) { return(GetHttpResponse(request, () => { var watchListedLoan = _LoanService.UpdateWatchListedLoan(watchListedLoanModel); return request.CreateResponse <WatchListedLoan>(HttpStatusCode.OK, watchListedLoan); })); }
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; })); }
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)); }