コード例 #1
0
        public HttpResponseMessage DeleteIFRSBond(HttpRequestMessage request, [FromBody] int bondId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                IFRSBonds ifrsbond = _IFRSDataService.GetIFRSBonds(bondId);

                if (ifrsbond != null)
                {
                    _IFRSDataService.DeleteIFRSBonds(bondId);

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

                return response;
            }));
        }