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)); }
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)); }
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))); }
public ActionResult Index(string filter) { int count; var accounts = query.Query(userAccountService.Configuration.DefaultTenant, filter, 0, 1000, out count); return(View("Index", accounts.ToArray())); }
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))); }
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))); }
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)); }