/// <summary>
        /// 根据系统编号删除权限数据
        /// </summary>
        /// <param name="sysNos">权限系统编号</param>
        public void DeleteAuthority(IEnumerable <long> sysNos)
        {
            if (sysNos.IsNullOrEmpty())
            {
                throw new Exception("没有指定任何要删除的权限");
            }
            IQuery delQuery = QueryFactory.Create <AuthorityQuery>(a => sysNos.Contains(a.SysNo));

            authRepository.Remove(delQuery);
        }
Beispiel #2
0
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="authorityCodes">要删除的权限编码</param>
        public static void DeleteAuthority(IEnumerable <string> authorityCodes)
        {
            if (authorityCodes.IsNullOrEmpty())
            {
                throw new Exception("应至少指定一个要删除的权限");
            }
            IQuery delQuery = QueryFactory.Create <AuthorityQuery>();

            delQuery.In <AuthorityQuery>(a => a.Code, authorityCodes);
            authRepository.Remove(delQuery);
        }