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

                // not that calling the WCF service here will authenticate access to the data
                Process process = _ExtractionProcessService.GetProcess(processId);

                if (process != null)
                {
                    _ExtractionProcessService.DeleteProcess(processId);

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

                return response;
            }));
        }