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