Exemplo n.º 1
0
        /// <summary>
        /// Determines if the page is published at this moment in time,
        /// checking the page and custom entity (if available) published status, the publish date
        /// and checking to make sure there is a published version.
        /// </summary>
        public bool IsPublished()
        {
            if (PageRoute == null)
            {
                throw new InvalidOperationException($"Cannot call {nameof(IsPublished)} if the {nameof(PageRoute)} property is null.");
            }

            var isPublished = PageRoute.IsPublished();

            if (isPublished && CustomEntityRoute != null)
            {
                isPublished = CustomEntityRoute.IsPublished();
            }

            return(isPublished);
        }