Пример #1
0
        public HttpResponseMessage DeleteSolutionRunDate(HttpRequestMessage request, [FromBody] int solutionRunDateId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                SolutionRunDate solutionRunDate = _ExtractionProcessService.GetSolutionRunDate(solutionRunDateId);

                if (solutionRunDate != null)
                {
                    _ExtractionProcessService.DeleteSolutionRunDate(solutionRunDateId);

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

                return response;
            }));
        }