ExistsAsync() public method

Checks if this directory exists
public ExistsAsync ( IFdbReadOnlyTransaction trans ) : Task
trans IFdbReadOnlyTransaction
return Task
示例#1
0
        /// <summary>Checks if this directory exists</summary>
        /// <returns>Returns true if the directory exists, otherwise false.</returns>
        public static Task <bool> ExistsAsync([NotNull] this FdbDirectorySubspace subspace, [NotNull] IFdbReadOnlyRetryable db, CancellationToken ct)
        {
            Contract.NotNull(subspace, nameof(subspace));
            Contract.NotNull(db, nameof(db));

            return(db.ReadAsync((tr) => subspace.ExistsAsync(tr), ct));
        }
        /// <summary>Checks if this directory exists</summary>
        /// <returns>Returns true if the directory exists, otherwise false.</returns>
        public static Task <bool> ExistsAsync([NotNull] this FdbDirectorySubspace subspace, [NotNull] IFdbReadOnlyRetryable db, CancellationToken ct)
        {
            if (subspace == null)
            {
                throw new ArgumentNullException(nameof(subspace));
            }
            if (db == null)
            {
                throw new ArgumentNullException(nameof(db));
            }

            return(db.ReadAsync((tr) => subspace.ExistsAsync(tr), ct));
        }