예제 #1
0
        public ActionResultDTO Put(int id, ImageEntity image)
        {
            image.Id = id;
            var result = _imageServices.UpdateImage(image);

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