/// <summary>
        /// Remove items from an index
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="keepIfUnpublished">
        /// If true, indicates that we will only delete this item from indexes that don't support unpublished content.
        /// If false it will delete this from all indexes regardless.
        /// </param>
        private void DeleteIndexForEntity(int entityId, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(this, entityId, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(this, entityId, keepIfUnpublished);
            }
        }
        /// <summary>
        /// Remove items from any index that doesn't support unpublished content
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="keepIfUnpublished">
        /// If true, indicates that we will only delete this item from indexes that don't support unpublished content.
        /// If false it will delete this from all indexes regardless.
        /// </param>
        private static void DeleteIndexForEntity(int entityId, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(ApplicationContext.Current.ScopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(entityId, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(entityId, keepIfUnpublished);
            }
        }
Exemple #3
0
        /// <inheritdoc />
        public void DeleteIndexForEntities(IReadOnlyCollection <int> entityIds, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(this, entityIds, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(this, entityIds, keepIfUnpublished);
            }
        }