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

                // not that calling the WCF service here will authenticate access to the data
                OpexManagementTree opexManagementTree = _MPROPEXService.GetOpexManagementTree(opexmgtTreeId);

                if (opexManagementTree != null)
                {
                    _MPROPEXService.DeleteOpexManagementTree(opexmgtTreeId);

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

                return response;
            }));
        }