예제 #1
0
        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;
            }));
        }