Exemple #1
0
 /// <summary>
 /// 判断角色存在
 /// </summary>
 /// <param name="sysUserId">用户角色主键</param>
 /// <returns></returns>
 public async Task <bool> ExistsSysUser(Guid sysUserId)
 {
     using (IDAL.System.ISysUserDao sysUserDao = new SysUserDao())
     {
         return(await sysUserDao.GetAllAsync().AnyAsync(m => m.Id == sysUserId));
     }
 }
Exemple #2
0
        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="sysUserId"></param>
        /// <returns></returns>
        public async Task <SysUser> GetOneSysUserById(Guid sysUserId)
        {
            using (IDAL.System.ISysUserDao sysUserDao = new SysUserDao())
            {
                var user = await sysUserDao.GetAllAsync()
                           .Where(m => m.Id == sysUserId)
                           .Include(m => m.SysDepart)
                           .Include(m => m.SysUserRoles)
                           .Include(m => m.SysUserRoles
                                    .Select(a => a.SysRole)).FirstAsync();


                return(user);
            }
        }