Exemple #1
0
        public override void Delete(ContentItem item)
        {
            using (var tx = repository.BeginTransaction())
            {
                // delete inbound references, these would cuase fk violation in the database
                repository.RemoveReferencesToRecursive(item);

                DeleteRecursive(item);

                tx.Commit();
            }
        }
Exemple #2
0
        public override void Delete(ContentItem item)
        {
            var versionRepository = Engine.Resolve <ContentVersionRepository>();

            using (var tx = repository.BeginTransaction())
            {
                try
                {
                    // delete inbound references, these would cuase fk violation in the database
                    repository.RemoveReferencesToRecursive(item);
                    DeleteRecursive(item, versionRepository);

                    tx.Commit();
                }
                catch (Exception ex)
                {
                    tx.Rollback();
                    logger.Error(ex);
                    throw;
                }
            }
        }