Beispiel #1
0
        public ActionResultDTO Post(ImageEntity image)
        {
            var result = _imageServices.AddImage(image);

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