コード例 #1
0
        // CacheManager0
        private static SoftFluent.Samples.AzureCache.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.AzureCache.CategoryCollection ret = null;
            string cacheKey = null;

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

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