diff --git a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs index 086977b732de0..c00d412854193 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample01b_HelloWorldAsync.cs @@ -43,8 +43,11 @@ public async Task CreateFileClientAsync_Filesystem() await file.CreateAsync(); // Verify we created one file - AsyncPageable response = filesystem.GetPathsAsync(); - IList paths = await response.ToListAsync(); + List paths = new List(); + await foreach (PathItem path in filesystem.GetPathsAsync()) + { + paths.Add(path); + } Assert.AreEqual(1, paths.Count); // Cleanup @@ -80,8 +83,11 @@ public async Task CreateFileClientAsync_Directory() await file.CreateAsync(); // Verify we created one file - AsyncPageable response = filesystem.GetPathsAsync(); - IList paths = await response.ToListAsync(); + List paths = new List(); + await foreach (PathItem path in filesystem.GetPathsAsync()) + { + paths.Add(path); + } Assert.AreEqual(1, paths.Count); // Cleanup @@ -113,8 +119,11 @@ public async Task CreateDirectoryClientAsync() await directory.CreateAsync(); // Verify we created one directory - AsyncPageable response = filesystem.GetPathsAsync(); - IList paths = await response.ToListAsync(); + List paths = new List(); + await foreach (PathItem path in filesystem.GetPathsAsync()) + { + paths.Add(path); + } Assert.AreEqual(1, paths.Count); // Cleanup @@ -198,8 +207,11 @@ public async Task AppendAsync() await file.CreateAsync(); // Verify we created one file - AsyncPageable response = filesystem.GetPathsAsync(); - IList paths = await response.ToListAsync(); + List paths = new List(); + await foreach (PathItem path in filesystem.GetPathsAsync()) + { + paths.Add(path); + } Assert.AreEqual(1, paths.Count); // Append data to an existing DataLake File. Append is currently limited to 4000 MB per call.