Exemplo n.º 1
0
        public IList <District> findDistrict(string city)
        {
            IList <District> dis       = null;
            string           group_key = "Select_District " + city;

            if (enableCaching)
            {
                dis = (IList <District>)HttpRuntime.Cache[group_key];
            }
            if (dis == null)
            {
                dis = manager.findDistrict(city);
            }
            // Check if the data exists in the data cache
            if (dis != null && dis.Count() > 0)
            {
                //// If the data is not in the cache then fetch the data from the business logic tier
                AggregateCacheDependency cd = DependencyFacade.GetDistrictSelDependency();
                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object
                HttpRuntime.Cache.Add(group_key, dis, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }
            return(dis);
        }