Esempio n. 1
0
        public bool HasPageChanged(string url)
        {
            DateTime lastPublishedDate = DateTime.MinValue;

            if (CacheService.ContainsLastPublishDate(url))
            {
                lastPublishedDate = CacheService.GetLastPublishDate(url);
            }

            var dbLastPublishedDate = GetLastPublishedDateByUrl(url);

            if (lastPublishedDate != DateTime.MinValue && lastPublishedDate.Subtract(dbLastPublishedDate).TotalSeconds >= 0)
            {
                return(false);
            }
            else
            {
                CacheService.SetLastPublishDate(url, dbLastPublishedDate);
                return(true);
            }
        }
Esempio n. 2
0
        public bool HasPageChanged(TcmUri tcmUri)
        {
            DateTime lastPublishedDate = DateTime.MinValue;
            string   stringUri         = tcmUri.ToString();

            if (CacheService.ContainsLastPublishDate(stringUri))
            {
                lastPublishedDate = CacheService.GetLastPublishDate(stringUri);
            }

            var dbLastPublishedDate = GetLastPublishedDateByUri(stringUri);

            if (lastPublishedDate != DateTime.MinValue && lastPublishedDate.Subtract(dbLastPublishedDate).TotalSeconds >= 0)
            {
                return(false);
            }
            else
            {
                CacheService.SetLastPublishDate(stringUri, dbLastPublishedDate);
                return(true);
            }
        }