private async Task <SitemapRouteDocument> CreateDocumentAsync()
        {
            var sitemaps = await SitemapManager.GetSitemapsAsync();

            var document = new SitemapRouteDocument();

            BuildEntries(document, sitemaps);

            return(document);
        }
        private void BuildEntries(SitemapRouteDocument document, IEnumerable <SitemapType> sitemaps)
        {
            document.SitemapIds.Clear();
            document.SitemapPaths.Clear();

            foreach (var sitemap in sitemaps)
            {
                if (!sitemap.Enabled)
                {
                    continue;
                }

                document.SitemapIds[sitemap.Path]        = sitemap.SitemapId;
                document.SitemapPaths[sitemap.SitemapId] = sitemap.Path;
            }
        }
Beispiel #3
0
        private async Task BuildEntriesAsync(string identifier)
        {
            var document = new SitemapRouteDocument()
            {
                Identifier = identifier
            };

            var sitemaps = await _sitemapManager.GetSitemapsAsync();

            foreach (var sitemap in sitemaps)
            {
                if (!sitemap.Enabled)
                {
                    continue;
                }

                document.SitemapIds[sitemap.Path]        = sitemap.SitemapId;
                document.SitemapPaths[sitemap.SitemapId] = sitemap.Path;
            }

            _document = document;
        }