diff --git a/zero/FileStorage/IFileSystem.cs b/zero/FileStorage/IFileSystem.cs index bd8c5238..18e619bc 100644 --- a/zero/FileStorage/IFileSystem.cs +++ b/zero/FileStorage/IFileSystem.cs @@ -57,7 +57,7 @@ public interface IFileSystem /// /// Get all items within a directory /// - IAsyncEnumerable GetDirectoryContent(string path = null, bool recursive = false, CancellationToken cancellationToken = default); + IEnumerable GetDirectoryContent(string path = null, bool recursive = false, CancellationToken cancellationToken = default); /// /// Tries to create a directory at the given path. This method returns if the directory already exists. diff --git a/zero/FileStorage/PhysicalFileSystem.cs b/zero/FileStorage/PhysicalFileSystem.cs index 4248c828..3981c5ac 100644 --- a/zero/FileStorage/PhysicalFileSystem.cs +++ b/zero/FileStorage/PhysicalFileSystem.cs @@ -196,17 +196,17 @@ public class PhysicalFileSystem : IFileSystem /// - public virtual IAsyncEnumerable GetDirectoryContent(string path = null, bool recursive = false, CancellationToken cancellationToken = default) + public virtual IEnumerable GetDirectoryContent(string path = null, bool recursive = false, CancellationToken cancellationToken = default) { try { string resolvedPath = ResolvePath(path); - List results = new(); + List results = []; SearchOption searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; if (!Directory.Exists(resolvedPath)) { - return results.ToAsyncEnumerable(); + return results; } results.AddRange(Directory.GetDirectories(resolvedPath, "*", searchOption).Select(f => @@ -221,7 +221,7 @@ public class PhysicalFileSystem : IFileSystem return new PhysicalFileMeta(fileSystemInfo, ResolvePath(f.Substring(_root.Length))); })); - return results.ToAsyncEnumerable(); + return results; } catch (Exception ex) when (ex is not FileSystemException) { diff --git a/zero/zero.csproj b/zero/zero.csproj index c043943b..f1ed52b4 100644 --- a/zero/zero.csproj +++ b/zero/zero.csproj @@ -18,7 +18,6 @@ - \ No newline at end of file