Пример #1
0
        public Order Create(Order order)
        {
            Order groups = null;

            if (!enableCaching)
            {
                return(order);
            }
            string group_key = "Create_Order " + order.ID;

            groups = (Order)HttpRuntime.Cache[group_key];
            // Check if the data exists in the data cache
            if (groups == null && order != null)
            {
                //// If the data is not in the cache then fetch the data from the business logic tier
                AggregateCacheDependency cd = DependencyFacade.GetOrderCreateDependency();
                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object
                HttpRuntime.Cache.Add(group_key, order, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }
            return(order);
        }