From cb280178c7f25b9046d377b1c9c5c2881fa91d9b Mon Sep 17 00:00:00 2001 From: Jericho Date: Thu, 28 Jan 2021 15:51:29 -0500 Subject: [PATCH] (GH-368) Add missing 'limit' and 'offset' parameters to IpAddresses.GetUnassignedAsync --- Source/StrongGrid/Extensions/Public.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/StrongGrid/Extensions/Public.cs b/Source/StrongGrid/Extensions/Public.cs index 68f83406..c859e854 100644 --- a/Source/StrongGrid/Extensions/Public.cs +++ b/Source/StrongGrid/Extensions/Public.cs @@ -1158,10 +1158,10 @@ public static async Task GetUnassignedAsync(this IIpAddresses ipAdd while (true) { var allIpAddresses = await ipAddresses.GetAllAsync(limit: Utils.MaxSendGridPagingLimit, offset: currentOffset, cancellationToken: cancellationToken).ConfigureAwait(false); - unassignedIpAddresses.AddRange(allIpAddresses.Where(ip => ip.Pools == null || !ip.Pools.Any())); + unassignedIpAddresses.AddRange(allIpAddresses.Records.Where(ip => ip.Pools == null || !ip.Pools.Any())); if (unassignedIpAddresses.Count >= offset + limit) break; - if (allIpAddresses.Length < Utils.MaxSendGridPagingLimit) break; + if (allIpAddresses.Next == null) break; currentOffset += Utils.MaxSendGridPagingLimit; }