Example #1
0
        public HttpResponseMessage DeleteCreditRiskRating(HttpRequestMessage request, [FromBody] int creditRiskRatingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                CreditRiskRating creditRiskRating = _LoanService.GetCreditRiskRating(creditRiskRatingId);

                if (creditRiskRating != null)
                {
                    _LoanService.DeleteCreditRiskRating(creditRiskRatingId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Opex Business Rule found under that ID.");
                }

                return response;
            }));
        }