public HttpResponseMessage GetLoanInterestRate(HttpRequestMessage request, int LoanInterestRate_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; LoanInterestRate loanInterestRate = _IFRSDataService.GetLoanInterestRate(LoanInterestRate_Id); // notice no need to create a seperate model object since LoanInterestRate entity will do just fine response = request.CreateResponse <LoanInterestRate>(HttpStatusCode.OK, loanInterestRate); return response; })); }
public HttpResponseMessage DeleteLoanInterestRate(HttpRequestMessage request, [FromBody] int LoanInterestRate_Id) { return(GetHttpResponse(request, () => { HttpResponseMessage response = null; // not that calling the WCF service here will authenticate access to the data LoanInterestRate loanInterestRate = _IFRSDataService.GetLoanInterestRate(LoanInterestRate_Id); if (loanInterestRate != null) { _IFRSDataService.DeleteLoanInterestRate(LoanInterestRate_Id); response = request.CreateResponse(HttpStatusCode.OK); } else { response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No loanInterestRate found under that ID."); } return response; })); }
public HttpResponseMessage UpdateLoanInterestRate(HttpRequestMessage request, [FromBody] LoanInterestRate loanInterestRateModel) { return(GetHttpResponse(request, () => { var loanInterestRate = _IFRSDataService.UpdateLoanInterestRate(loanInterestRateModel); return request.CreateResponse <LoanInterestRate>(HttpStatusCode.OK, loanInterestRate); })); }
//public Placement[] GetPlacementByRefNo(string RefNo) //{ // return Channel.GetPlacementByRefNo(RefNo); //} #endregion #region LoanInterestRate public LoanInterestRate UpdateLoanInterestRate(LoanInterestRate loanInterestRate) { return(Channel.UpdateLoanInterestRate(loanInterestRate)); }