コード例 #1
0
        public async Task <UserCollection> GetUsersFromAPIM()
        {
            //ALB: The NextLink metaphor is to get all users by page. Using this technique since the quantity known for this project is less than 300.
            string         nextLink = "";
            UserCollection users    = await GetApiManagementUsersAsync(APIMSubscriptionId, APIMResourceGroup, APIMServiceName);

            int totalUsers  = users.count;
            int incrementor = 100;

            //users.count is the expected number of users, while users.value.length is the actual number of users
            while (users.value.Length < totalUsers)
            {
                // since the request is limited to 100 users, this will get the next list of users and add them.
                UserCollection nextUsers = await GetApiManagementUsersAsync(APIMSubscriptionId, APIMResourceGroup, APIMServiceName, incrementor);

                users.AddUserCollection(nextUsers);

                incrementor += 100;
            }

            return(users);
        }