private IList <PrincipalInfo> GetUserPrincipals(string input, int limit) { using (ClientContext context = new Authentication.LowTrustTokenHelper(_tokenHelper).GetUserClientContext()) { var users = Utility.SearchPrincipals(context, context.Web, input, PrincipalType.User, PrincipalSource.UserInfoList, context.Web.SiteUsers, limit); context.ExecuteQuery(); return(users); } }
private UserCollection GetSiteUsers() { using (ClientContext context = new Authentication.LowTrustTokenHelper(_tokenHelper).GetUserClientContext()) { var users = context.Web.SiteUsers; context.Load(users, user => user.Include(u => u.Title, u => u.LoginName, u => u.Email, u => u.UserPrincipalName, u => u.Id)); context.ExecuteQuery(); return(users); } }