Ejemplo n.º 1
0
        public List<T_SYS_PERMISSION> FindSysPermissionByStr(string sName)
        {
            using (SysPermissionBLL bll = new SysPermissionBLL())
            {
                #region 
                List<T_SYS_PERMISSION> perList;
                string keyString = "FindSysPermissionByStr" + sName;
                if (WCFCache.Current[keyString] == null)
                {
                    IQueryable<T_SYS_PERMISSION> IQList = bll.FindSysPermissionByStr(sName);
                    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;
            }
        }