/// <summary>
        /// Gets all variant ids.
        /// </summary>
        /// <returns>An IEnumerable of ids.</returns>
        private IEnumerable <int> GetAllVariantIds()
        {
            List <int> variantIdList = new List <int>();

            IEnumerable <CatalogContent> catalogs = this.contentLoader.GetChildren <CatalogContent>(
                this.referenceConverter.GetRootLink(),
                new LoaderOptions {
                LanguageLoaderOption.MasterLanguage()
            });

            foreach (CatalogContent catalogContent in catalogs)
            {
                if (this.stopSignaled)
                {
                    break;
                }

                foreach (VariationContent variant in this.GetEntriesRecursive <VariationContent>(
                             parentLink: catalogContent.ContentLink,
                             defaultCulture: catalogContent.MasterLanguage))
                {
                    if (this.stopSignaled)
                    {
                        break;
                    }

                    variantIdList.Add(item: this.referenceConverter.GetObjectId(variant.ContentLink));
                }
            }

            return(variantIdList.Distinct());
        }
        private Dictionary <StartPage, IEnumerable <SitePageData> > GetStartPagesWithDescendants()
        {
            var dictionary = new Dictionary <StartPage, IEnumerable <SitePageData> >();
            var startPages = _contentLoader.GetChildren <StartPage>(SiteDefinition.Current.RootPage, new LoaderOptions {
                LanguageLoaderOption.MasterLanguage()
            });

            foreach (var startPage in startPages)
            {
                var descendants = _contentLoader.GetDescendents(startPage.ContentLink).ToSitePageData().Where(p =>
                                                                                                              !(p.Robots is null) && !p.Robots.ToLower().Contains("noindex") && !(p is IExcludeFromSiteMap));

                dictionary.Add(startPage, descendants);
            }

            return(dictionary);
        }
Ejemplo n.º 3
0
 private IEnumerable <StartPage> GetStartPages() => _contentRepository
 .GetChildren <StartPage>(SiteDefinition.Current.RootPage, new LoaderOptions {
     LanguageLoaderOption.MasterLanguage()
 });