public static async Task <IList <ResourceGroup> > ListAllAsync(this IResourceGroupsOperations operations)
        {
            var resourceGroups = new List <ResourceGroup>();

            var list = await operations.ListAsync();

            resourceGroups.AddRange(list);

            while (list.NextPageLink != null)
            {
                list = await operations.ListNextAsync(list.NextPageLink);

                resourceGroups.AddRange(list);
            }

            return(resourceGroups);
        }
 /// <summary>
 /// Retrieve a list of Resource Groups
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.SiteRecoveryVault.IResourceGroupsOperations.
 /// </param>
 /// <returns>
 /// The response model for the list resource group operation.
 /// </returns>
 public static Task <ResourceGroupListResponse> ListAsync(this IResourceGroupsOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
Exemple #3
0
 /// <summary>
 /// Gets all the resource groups for a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IPage <ResourceGroup> List(this IResourceGroupsOperations operations, ODataQuery <ResourceGroupFilter> odataQuery = default(ODataQuery <ResourceGroupFilter>))
 {
     return(operations.ListAsync(odataQuery).GetAwaiter().GetResult());
 }