Beispiel #1
0
        /// <summary>
        /// 查询角色信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        public static SysRole QuerySysRoleEntity(Expression <Func <SysRole, bool> > predicate)
        {
            using var db = new ContextBase(ContextBase.DCOB().Options);
            var mo = db.SysRole.Where(predicate).FirstOrDefault();

            return(mo);
        }
Beispiel #2
0
        /// <summary>
        /// 查询配置信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        public static List <SysTableConfig> QuerySysTableConfigList(Expression <Func <SysTableConfig, bool> > predicate)
        {
            using var db = new ContextBase(ContextBase.DCOB().Options);
            var list = db.SysTableConfig.Where(predicate).OrderBy(x => x.ColOrder).ToList();

            return(list);
        }
Beispiel #3
0
 /// <summary>
 /// 查询按钮
 /// </summary>
 /// <param name="predicate"></param>
 /// <param name="cache"></param>
 /// <returns></returns>
 public static List <SysButton> QuerySysButtonList(Func <SysButton, bool> predicate, bool cache = true)
 {
     if (!cache || !(Core.CacheTo.Get(GlobalCacheKey.SysButton) is List <SysButton> list))
     {
         using var db = new ContextBase(ContextBase.DCOB().Options);
         list         = db.SysButton.OrderBy(x => x.SbBtnOrder).ToList();
         Core.CacheTo.Set(GlobalCacheKey.SysButton, list, 300, false);
     }
     list = list.Where(predicate).ToList();
     return(list);
 }
Beispiel #4
0
        /// <summary>
        /// 查询角色信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="cache"></param>
        /// <returns></returns>
        public static SysRole QuerySysRoleEntity(Func <SysRole, bool> predicate, bool cache = true)
        {
            if (!cache || !(Core.CacheTo.Get(GlobalCacheKey.SysRole) is List <SysRole> list))
            {
                using var db = new ContextBase(ContextBase.DCOB().Options);
                list         = db.SysRole.ToList();
                Core.CacheTo.Set(GlobalCacheKey.SysRole, list, 300, false);
            }
            var mo = list.FirstOrDefault(predicate);

            return(mo);
        }
Beispiel #5
0
        public DataMirrorService()
        {
            db = new ContextBase(ContextBase.DCOB().Options);

            Tsb  = db.SysButton;
            Tsd  = db.SysDictionary;
            Tsm  = db.SysMenu;
            Tsr  = db.SysRole;
            Tstc = db.SysTableConfig;
            Tsu  = db.SysUser;
            Tte  = db.TempExample;
            Ttid = db.TempInvoiceDetail;
            Ttim = db.TempInvoiceMain;
        }