Ejemplo n.º 1
0
        public HttpResponseMessage Deleterevenue(HttpRequestMessage request, [FromBody] int revenueId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                Revenue revenue = _MPRPLService.GetRevenue(revenueId);

                if (revenue != null)
                {
                    _MPRPLService.DeleteRevenue(revenueId);

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

                return response;
            }));
        }