Example #1
0
        public HttpResponseMessage DeleteAuditTrail(HttpRequestMessage request, [FromBody] int auditTrailId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                AuditTrail auditTrail = _CoreService.GetAuditTrail(auditTrailId);

                if (auditTrail != null)
                {
                    _CoreService.DeleteAuditTrail(auditTrailId);

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

                return response;
            }));
        }