public static async Task <IList <Zone> > ListAllAsync(this IZonesOperations operations) { var zones = new List <Zone>(); var list = await operations.ListAsync(); zones.AddRange(list); while (list.NextPageLink != null) { list = await operations.ListNextAsync(list.NextPageLink); zones.AddRange(list); } return(zones); }
/// <summary> /// Lists the DNS zones in all resource groups in a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <Zone> ListNext(this IZonesOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }