Esempio n. 1
0
        private CatalogData GetCatalogData(string catalog)
        {
            var key = string.Format("__CatalogService_Catalog_{0}", catalog);

            if (Cache.ContainsKey(key))
            {
                return(Cache.Get <CatalogData>(key));
            }

            var data = new CatalogData(
                Configuration,
                Catalogs[catalog],
                Products.GetEnabledProducts());

            Cache.Put(key, data, TimeSpan.FromHours(24));
            return(data);
        }
        private CatalogData GetCatalogData(string catalog)
        {
            var key = string.Format("__CatalogService_Catalog_{0}", catalog);
            if (Cache.ContainsKey(key))
            {
                return Cache.Get<CatalogData>(key);
            }

            var data = new CatalogData(
                Configuration,
                Catalogs[catalog],
                Products.GetEnabledProducts());

            Cache.Put(key, data, TimeSpan.FromHours(24));
            return data;
        }