Example #1
0
        public List<T_SYS_PERMISSION> GetSysPermissionByEntityID(string EntityID)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                //SysPermissionBLL bll = new SysPermissionBLL();
                //IQueryable<T_SYS_PERMISSION> perList = bll.GetSysPermissionAll();
                #region 
                List<T_SYS_PERMISSION> perList;
                string keyString = "SysPermissionAll" + EntityID;


                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_PERMISSION> IQList = bll.GetPermissionByEntityID(EntityID);
                    perList = IQList == null ? null : IQList.ToList();
                    WCFCache.Current.Insert(keyString, perList, DateTime.Now.AddMinutes(15));

                }
                else
                {
                    perList = (List<T_SYS_PERMISSION>)WCFCache.Current[keyString];
                }

                #endregion
                return perList.Count() > 0 ? perList : null;
            }
        }