public async Task <ActionResult> RemoveImage(int id) { _logger.Info("Removing Image! ImageId: " + id); try { await _imageServices.DeleteImage(id, User.Identity.GetUserId()); _logger.Info("Removing Image Successfully!"); return(Json("STATUS_OK")); } catch (Exception ex) { _logger.Error(ex, "Removing Image Failed!"); throw; } }
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); }
public async Task <ActionResult> DeleteImage(int id) { await _imagesManager.DeleteImage(id, User.Identity.GetUserId()); return(Json("STATUS_OK")); }