Esempio n. 1
0
        public TableData LoadByRole(QueryUserListByRoleReq request)
        {
            var users = from userRole in UnitWork.Find <Relevance>(u => u.SecondId == request.roleId && u.Key == Define.USERROLE)
                        join user in UnitWork.Find <User>(null) on userRole.FirstId equals user.Id into temp
                        from c in temp.DefaultIfEmpty()
                        select c;

            return(new TableData
            {
                count = users.Count(),
                data = users.Skip((request.page - 1) * request.limit).Take(request.limit)
            });
        }
Esempio n. 2
0
        /// <summary>
        /// 获取指定角色包含的用户列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <TableData> LoadByRole(QueryUserListByRoleReq request)
        {
            var users = from userRole in UnitWork.Find <Relevance>(u =>
                                                                   u.SecondId == request.roleId && u.Key == Define.USERROLE)
                        join user in UnitWork.Find <User>(null) on userRole.FirstId equals user.Id into temp
                        from c in temp.Where(u => u.Id != null)
                        select c;

            return(new TableData
            {
                count = await users.CountAsync(),
                data = await users.Skip((request.page - 1) *request.limit).Take(request.limit).ToListAsync()
            });
        }
Esempio n. 3
0
 public async Task <TableData> LoadByRole([FromQuery] QueryUserListByRoleReq request)
 {
     return(await _app.LoadByRole(request));
 }
 public TableData LoadByRole([FromQuery] QueryUserListByRoleReq request)
 {
     return(_app.LoadByRole(request));
 }