Esempio n. 1
0
        public ActionResultDTO Delete(int id)
        {
            var image  = _imageServices.GetImage(id);
            var result = _imageServices.DeleteImage(id);

            if (result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            if (result.Success)
            {
                _auditLog.AuditType  = AuditEntry.Type.Delete;
                _auditLog.ObjectId   = result.Id;
                _auditLog.ObjectName = image.Name;
                _auditLog.Ip         = Request.GetClientIpAddress();
                _auditLogService.AddAuditLog(_auditLog);
            }
            return(result);
        }