public HttpResponseMessage UpdateSetup(HttpRequestMessage request, [FromBody] LoanSetup loanSetupModel) { return(GetHttpResponse(request, () => { var loanSetup = _LoanService.UpdateLoanSetup(loanSetupModel); return request.CreateResponse <LoanSetup>(HttpStatusCode.OK, loanSetup); })); }
public HttpResponseMessage GetSetup(HttpRequestMessage request, int loanSetupId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; LoanSetup loanSetup = _LoanService.GetLoanSetup(loanSetupId); // notice no need to create a seperate model object since Setup entity will do just fine response = request.CreateResponse <LoanSetup>(HttpStatusCode.OK, loanSetup); return response; })); }
public HttpResponseMessage DeleteSetup(HttpRequestMessage request, [FromBody] int loanSetupId) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data LoanSetup loanSetup = _LoanService.GetLoanSetup(loanSetupId); if (loanSetup != null) { _LoanService.DeleteLoanSetup(loanSetupId); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No loansetup found under that ID."); } return response; })); }
public LoanSetup UpdateLoanSetup(LoanSetup loanSetup) { return(Channel.UpdateLoanSetup(loanSetup)); }