public async Task <List <IUserInfo> > GetPage(
            int siteId,
            int pageNumber,
            int pageSize,
            string userNameBeginsWith,
            int sortMode,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            //sortMode: 0 = DisplayName asc, 1 = JoinDate desc, 2 = Last, First

            List <IUserInfo> userList = new List <IUserInfo>();

            using (DbDataReader reader = await dbSiteUser.GetUserListPage(
                       siteId, pageNumber, pageSize, userNameBeginsWith, sortMode))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    userList.Add(user);
                    //totalPages = Convert.ToInt32(reader["TotalPages"]);
                }
            }

            return(userList);
        }
Exemple #2
0
        public async Task <List <IUserInfo> > GetPage(
            int siteId,
            int pageNumber,
            int pageSize,
            string userNameBeginsWith,
            int sortMode)
        {
            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }

            //sortMode: 0 = DisplayName asc, 1 = JoinDate desc, 2 = Last, First

            List <IUserInfo> userList = new List <IUserInfo>();

            using (DbDataReader reader = dbSiteUser.GetUserListPage(
                       siteId,
                       pageNumber,
                       pageSize,
                       userNameBeginsWith,
                       sortMode))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    userList.Add(user);
                }
            }

            return(userList);
        }