Example #1
0
        // CacheManager0
        private static SoftFluent.Samples.RedisCache.CategoryCollection CachePageLoadAll(bool useCache, int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions)
        {
            if ((pageIndex < 0))
            {
                pageIndex = 0;
            }
            if ((pageSize < 0))
            {
                if ((pageOptions != null))
                {
                    pageSize = pageOptions.DefaultPageSize;
                }
                else
                {
                    pageSize = int.MaxValue;
                }
            }
            SoftFluent.Samples.RedisCache.CategoryCollection ret = null;
            string cacheKey = null;

            if ((useCache == true))
            {
                cacheKey = CodeFluent.Runtime.Caching.SimpleCacheManager.BuildCacheKey("69d80ec93c1e64a950b65ea0729f45bc", pageIndex, pageSize, pageOptions);
                ret      = SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Get("SoftFluent.Samples.RedisCache.Category", cacheKey) as SoftFluent.Samples.RedisCache.CategoryCollection;
                if ((ret != null))
                {
                    return(ret);
                }
            }
            ret = new SoftFluent.Samples.RedisCache.CategoryCollection();
            System.Data.IDataReader reader = null;
            try
            {
                reader = SoftFluent.Samples.RedisCache.CategoryCollection.PageDataLoadAll(pageOptions);
                if ((reader == null))
                {
                    if ((useCache == true))
                    {
                        SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Add("SoftFluent.Samples.RedisCache.Category", cacheKey, ret, null);
                    }
                    return(ret);
                }
                ret.LoadAll(pageIndex, pageSize, pageOptions, reader);
            }
            finally
            {
                if ((reader != null))
                {
                    reader.Dispose();
                }
                CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName);
            }
            if ((useCache == true))
            {
                SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Add("SoftFluent.Samples.RedisCache.Category", cacheKey, ret, null);
            }
            return(ret);
        }
Example #2
0
        public virtual void CopyTo(SoftFluent.Samples.RedisCache.CategoryCollection collection, bool deep)
        {
            if ((typeof(System.ICloneable).IsAssignableFrom(typeof(SoftFluent.Samples.RedisCache.Category)) == false))
            {
                deep = false;
            }
            System.Collections.Generic.IEnumerator <SoftFluent.Samples.RedisCache.Category> enumerator = this.GetEnumerator();
            bool b;

            for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext())
            {
                if ((deep == true))
                {
                    collection.Add(((SoftFluent.Samples.RedisCache.Category)(((System.ICloneable)(enumerator.Current)).Clone())));
                }
                else
                {
                    collection.Add(enumerator.Current);
                }
            }
        }
Example #3
0
 public virtual SoftFluent.Samples.RedisCache.CategoryCollection Clone(bool deep)
 {
     SoftFluent.Samples.RedisCache.CategoryCollection ret = new SoftFluent.Samples.RedisCache.CategoryCollection();
     this.CopyTo(ret, deep);
     return(ret);
 }
Example #4
0
 public static SoftFluent.Samples.RedisCache.CategoryCollection LoadAll()
 {
     SoftFluent.Samples.RedisCache.CategoryCollection ret = SoftFluent.Samples.RedisCache.CategoryCollection.PageLoadAll(int.MinValue, int.MaxValue, null);
     return(ret);
 }