/// <summary>Returns the list of subdirectories of the sub-directory with the given <paramref name="name"/>, if it exists</summary> public static Task <List <string> > TryListAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbReadOnlyRetryable db, [NotNull] string name, CancellationToken ct) { if (directory == null) { throw new ArgumentNullException(nameof(directory)); } if (db == null) { throw new ArgumentNullException(nameof(db)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } return(db.ReadAsync((tr) => directory.TryListAsync(tr, new [] { name }), ct)); }
/// <summary>Returns the list of subdirectories of the sub-directory with the given <paramref name="name"/>, if it exists</summary> public static Task <List <string> > TryListAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbReadOnlyTransaction trans, [NotNull] string name) { if (directory == null) { throw new ArgumentNullException(nameof(directory)); } if (trans == null) { throw new ArgumentNullException(nameof(trans)); } if (name == null) { throw new ArgumentNullException(nameof(name)); } return(directory.TryListAsync(trans, new[] { name })); }
/// <summary>Returns the list of all the top level directories of this database instance.</summary> public Task <List <string> > TryListAsync(CancellationToken cancellationToken) { //REVIEW: is it possible for this method to fail on a top-level db partition? // => it not, should be removed because it is a duplicate of ListAsync(..) return(m_database.ReadWriteAsync((tr) => m_directory.TryListAsync(tr), cancellationToken)); }