public virtual IEnumerable<PSApplication> ListApplications(string resourceGroupName, string accountName)
{
if (string.IsNullOrEmpty(resourceGroupName))
{
// use resource mgr to see if account exists and then use resource group name to do the actual lookup
resourceGroupName = GetGroupForAccount(accountName);
}
IPage<Application> response = BatchManagementClient.Application.List(resourceGroupName, accountName);
List<PSApplication> psApplications = response.Select(ConvertApplicationToPSApplication).ToList();
string nextLink = response.NextPageLink;
while (nextLink != null)
{
response = BatchManagementClient.Application.ListNext(nextLink);
psApplications.AddRange(response.Select(ConvertApplicationToPSApplication));
nextLink = response.NextPageLink;
}
return psApplications;
}