示例#1
0
        public IList <Station> findStation(long zoneId)
        {
            IList <Station> stations  = null;
            string          group_key = "Select_Station" + zoneId;

            //如果不允许缓存
            if (enableCaching)
            {
                stations = HttpRuntime.Cache[group_key] as IList <Station>;
            }
            if (stations == null)
            {
                stations = manager.findStation(zoneId);
            }
            // Check if the data exists in the data cache
            if (stations != null && stations.Count() > 0)
            {
                //// If the data is not in the cache then fetch the data from the business logic tier
                AggregateCacheDependency cd = DependencyFacade.GetStationSelDependency();
                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object
                HttpRuntime.Cache.Add(group_key, stations, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }
            return(stations);
        }