Ejemplo n.º 1
0
        public async Task <IList <IUserInfo> > GetUsersNotInRole(
            int siteId,
            int roleId,
            string searchInput,
            int pageNumber,
            int pageSize)
        {
            IList <IUserInfo> users = new List <IUserInfo>();

            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }

            using (DbDataReader reader = await dbRoles.GetUsersNotInRole(siteId, roleId, searchInput, pageNumber, pageSize))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    users.Add(user);
                }
            }

            return(users);
        }
Ejemplo n.º 2
0
        public async Task <IList <IUserInfo> > GetUsersNotInRole(
            int siteId,
            int roleId,
            string searchInput,
            int pageNumber,
            int pageSize,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            IList <IUserInfo> users = new List <IUserInfo>();

            using (DbDataReader reader = await dbRoles.GetUsersNotInRole(siteId, roleId, searchInput, pageNumber, pageSize))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    users.Add(user);
                }
            }

            return(users);
        }