コード例 #1
0
 public IEnumerable <string> GetUsers(int start, int count, out int totalCount)
 {
     if (start < 1)
     {
         start = 0;
     }
     if (count < 0)
     {
         count = 10;
     }
     start = (start - 1) * count;
     return(userQuery.Query(userSvc.Configuration.DefaultTenant, null, start, count, out totalCount).Select(x => x.Username));
 }
コード例 #2
0
ファイル: IdentityRepository.cs プロジェクト: Fazzani/BlsSTS
        public IEnumerable <string> GetUsers(int start, int count, out int totalCount)
        {
            // convert from pages to rows
            if (start < 0)
            {
                start = 0;
            }
            if (count < 0)
            {
                count = 10;
            }
            var skip = start * count;

            return(userQuery.Query(userSvc.Configuration.DefaultTenant, null, skip, count, out totalCount).Select(x => x.Username));
        }
コード例 #3
0
ファイル: UserManager.cs プロジェクト: retslig/ANDP
        public Task <UserManagerResult <QueryResult> > QueryUsersAsync(string filter, int start, int count)
        {
            int total;
            var users = query.Query(filter, start, count, out total).ToArray();

            var result = new QueryResult();

            result.Start  = start;
            result.Count  = count;
            result.Total  = total;
            result.Filter = filter;
            result.Users  = users.Select(x =>
            {
                var user = new UserResult
                {
                    Subject     = x.ID.ToString("D"),
                    Username    = x.Username,
                    Tenant      = x.Tenant,
                    DisplayName = DisplayNameFromUserId(x.ID)
                };

                return(user);
            }).ToArray();

            return(Task.FromResult(new UserManagerResult <QueryResult>(result)));
        }
コード例 #4
0
        public ActionResult Index(string filter)
        {
            int count;
            var accounts = query.Query(userAccountService.Configuration.DefaultTenant, filter, 0, 1000, out count);

            return(View("Index", accounts.ToArray()));
        }
コード例 #5
0
        public ActionResult Index(string filter)
        {
            int count;
            var accounts = query.Query(list =>
            {
                if (filter != null)
                {
                    list = list.Where(x => x.Username.Contains(filter));
                }
                return(list);
            },
                                       null,
                                       //list => list.OrderBy(x=>x.Username),
                                       0, 1000, out count);

            return(View("Index", accounts.ToArray()));
        }
        public Task <IdentityManagerResult <QueryResult <UserSummary> > > QueryUsersAsync(string filter, int start, int count)
        {
            if (start < 0)
            {
                start = 0;
            }
            if (count < 0)
            {
                count = Int32.MaxValue;
            }

            var filterFunc = this.Filter;

            if (String.IsNullOrWhiteSpace(filter))
            {
                filterFunc = (q, f) => q;
            }

            int total;
            var users = userQuery.Query(query => filterFunc(query, filter), Sort, start, count, out total).ToArray();

            var result = new QueryResult <UserSummary>();

            result.Start  = start;
            result.Count  = count;
            result.Total  = total;
            result.Filter = filter;
            result.Items  = users.Select(x =>
            {
                var user = new UserSummary
                {
                    Subject  = x.ID.ToString("D"),
                    Username = x.Username,
                    Name     = DisplayNameFromUserId(x.ID)
                };

                return(user);
            }).ToArray();

            return(Task.FromResult(new IdentityManagerResult <QueryResult <UserSummary> >(result)));
        }
コード例 #7
0
        public Task <UserManagementResult <QueryResult <UserSummary> > > QueryUsersAsync(string filter, int start, int count)
        {
            if (start < 0)
            {
                start = 0;
            }

            if (count < 0)
            {
                count = Int32.MaxValue;
            }

            var filterFunc = Filter;

            if (String.IsNullOrWhiteSpace(filter))
            {
                filterFunc = (q, f) => q;
            }

            int total;
            var users = _userQuery.Query(query => filterFunc(query, filter), Sort, start, count, out total).ToArray();

            var result = new QueryResult <UserSummary>(
                start,
                count,
                total,
                filter,
                users.Select(x =>
                             new UserSummary(
                                 x.ID.ToString("D"),
                                 x.Username,
                                 DisplayNameFromUserId(x.ID)))
                .ToArray());

            return(Task.FromResult(new UserManagementResult <QueryResult <UserSummary> >(result)));
        }
コード例 #8
0
 public IEnumerable <string> GetUsers(int start, int count, out int totalCount)
 {
     return(userQuery.Query(userSvc.Configuration.DefaultTenant, null, start, count, out totalCount).Select(x => x.Username));
 }