Exemple #1
0
        public Models.Repository Get(Models.Repository dummy)
        {
            var cacheKey = GetCacheKey(dummy);
            var o        = (Repository)dummy.ObjectCache().Get(cacheKey);

            if (o == null)
            {
                o = inner.Get(dummy);
                if (o == null)
                {
                    return(o);
                }
                dummy.ObjectCache().Add(cacheKey, o, Kooboo.CMS.Caching.ObjectCacheExtensions.DefaultCacheItemPolicy);
            }
            return(o);
        }
Exemple #2
0
        public void Update(Models.Repository @new, Models.Repository old)
        {
            inner.Update(@new, old);
            var cacheKey = GetCacheKey(@new);

            @new.ObjectCache().Remove(cacheKey);
        }
Exemple #3
0
        public Models.Repository Get(Models.Repository dummy)
        {
            var cacheKey = GetCacheKey(dummy);
            var o        = (Repository)dummy.ObjectCache().Get(cacheKey);

            if (o == null)
            {
                o = inner.Get(dummy);
                if (o == null)
                {
                    return(o);
                }
                dummy.ObjectCache().Add(cacheKey, o, CacheProviderFactory.DefaultCacheItemPolicy);
            }
            return(o);
        }