Beispiel #1
0
        /// <summary>Removes the directory, its contents, and all subdirectories.
        /// Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
        /// </summary>
        public static Task <bool> TryRemoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, FdbDirectoryPath path, CancellationToken ct)
        {
            Contract.NotNull(directory, nameof(directory));
            Contract.NotNull(db, nameof(db));

            return(db.ReadWriteAsync((tr) => directory.TryRemoveAsync(tr, path), ct));
        }
Beispiel #2
0
        /// <summary>Removes the directory, its contents, and all subdirectories.
        /// Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
        /// </summary>
        public static Task <bool> TryRemoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, [NotNull] string name, CancellationToken ct)
        {
            Contract.NotNull(directory, nameof(directory));
            Contract.NotNull(db, nameof(db));
            Contract.NotNull(name, nameof(name));

            return(db.ReadWriteAsync((tr) => directory.TryRemoveAsync(tr, new [] { name }), ct));
        }
        /// <summary>Removes the directory, its contents, and all subdirectories.
        /// Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
        /// </summary>
        public static Task <bool> TryRemoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, IEnumerable <string> path, CancellationToken ct)
        {
            if (directory == null)
            {
                throw new ArgumentNullException(nameof(directory));
            }
            if (db == null)
            {
                throw new ArgumentNullException(nameof(db));
            }

            return(db.ReadWriteAsync((tr) => directory.TryRemoveAsync(tr, path), ct));
        }
        /// <summary>Removes the directory, its contents, and all subdirectories.
        /// Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
        /// </summary>
        public static Task <bool> TryRemoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbTransaction 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.TryRemoveAsync(trans, new[] { name }));
        }
        /// <summary>Removes the directory, its contents, and all subdirectories.
        /// Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.
        /// </summary>
        public static Task <bool> TryRemoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, [NotNull] string name, CancellationToken cancellationToken)
        {
            if (directory == null)
            {
                throw new ArgumentNullException("directory");
            }
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            return(db.ReadWriteAsync((tr) => directory.TryRemoveAsync(tr, new [] { name }), cancellationToken));
        }
Beispiel #6
0
 public Task <bool> TryRemoveAsync([NotNull] string name, CancellationToken cancellationToken)
 {
     return(m_database.ReadWriteAsync((tr) => m_directory.TryRemoveAsync(tr, new string[] { name }), cancellationToken));
 }