コード例 #1
0
        private SiteMapResource MapPageResource(PageRoute pageRoute)
        {
            var version  = pageRoute.Versions.GetVersionRouting(PublishStatusQuery.Published);
            var resource = new SiteMapResource();

            resource.Url = pageRoute.FullPath;
            resource.LastModifiedDate = pageRoute.PublishDate;
            resource.Priority         = GetPriority(pageRoute);

            return(resource);
        }
コード例 #2
0
        private SiteMapResource MapCustomEntityResource(PageRoute pageRoute, CustomEntityRoute customEntityRoute, IEnumerable <ICustomEntityRoutingRule> allRules)
        {
            var version = customEntityRoute.Versions.GetVersionRouting(PublishStatusQuery.Published);

            if (version == null)
            {
                return(null);
            }

            var rule = allRules.FirstOrDefault(r => r.RouteFormat == pageRoute.UrlPath);

            if (rule == null)
            {
                return(null);
            }

            var resource = new SiteMapResource();

            resource.Url = rule.MakeUrl(pageRoute, customEntityRoute);
            resource.LastModifiedDate = customEntityRoute.PublishDate;
            resource.Priority         = GetPriority(pageRoute);

            return(resource);
        }