/// <returns>Generic List of CategoryInfo</returns> /// <summary> /// This method acts as a proxy between the web and business components to check whether the /// underlying data has already been cached. /// </summary> /// <returns>List of CategoryInfo from Cache or Business component</returns> public UserLogin Create(UserGroup Base, UserLogin login, User info, UserRegister register) { //存入消息 orderQueue.Send(Base, login, info, register); //orderQueue.Send(login); //orderQueue.Send(info); //orderQueue.Send(register); //如果不允许缓存 if (!enableCaching) { return(login); } string group_key = "UserReg_Group" + login.LoginID; string login_key = "UserReg_Login" + login.LoginID; string user_key = "UserReg_User" + login.LoginID; string regist_key = "UserReg_Register" + login.LoginID; UserGroup groups = (UserGroup)HttpRuntime.Cache[group_key]; UserLogin logins = (UserLogin)HttpRuntime.Cache[group_key]; User users = (User)HttpRuntime.Cache[group_key]; UserRegister regs = (UserRegister)HttpRuntime.Cache[group_key]; // Check if the data exists in the data cache if (groups == null && logins == null && users == null && regs == null) { //// If the data is not in the cache then fetch the data from the business logic tier //data = cat.GetCategories(); // Create a AggregateCacheDependency object from the factory AggregateCacheDependency cd = DependencyFacade.GetUserRegistDependency(); // Store the output in the data cache, and Add the necessary AggregateCacheDependency object // HttpRuntime.Cache.Add(group_key, Base, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); HttpRuntime.Cache.Add(login_key, login, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); // HttpRuntime.Cache.Add(user_key, info, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); // HttpRuntime.Cache.Add(regist_key, register, cd, DateTime.Now.AddHours(UserRegTimeout), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return(login); }