예제 #1
0
        /// <summary>Attempts to move the directory found at <paramref name="oldPath"/> to <paramref name="newPath"/>.
        /// There is no effect on the physical prefix of the given directory, or on clients that already have the directory open.
        /// </summary>
        public static Task <FdbDirectorySubspace> TryMoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, FdbDirectoryPath oldPath, FdbDirectoryPath newPath, CancellationToken ct)
        {
            Contract.NotNull(directory, nameof(directory));
            Contract.NotNull(db, nameof(db));

            return(db.ReadWriteAsync((tr) => directory.TryMoveAsync(tr, oldPath, newPath), ct));
        }
        /// <summary>Attempts to move the directory found at <paramref name="oldPath"/> to <paramref name="newPath"/>.
        /// There is no effect on the physical prefix of the given directory, or on clients that already have the directory open.
        /// </summary>
        public static Task <FdbDirectorySubspace> TryMoveAsync([NotNull] this IFdbDirectory directory, [NotNull] IFdbRetryable db, [NotNull] IEnumerable <string> oldPath, [NotNull] IEnumerable <string> newPath, CancellationToken ct)
        {
            if (directory == null)
            {
                throw new ArgumentNullException(nameof(directory));
            }
            if (db == null)
            {
                throw new ArgumentNullException(nameof(db));
            }
            if (oldPath == null)
            {
                throw new ArgumentNullException(nameof(oldPath));
            }
            if (newPath == null)
            {
                throw new ArgumentNullException(nameof(newPath));
            }

            return(db.ReadWriteAsync((tr) => directory.TryMoveAsync(tr, oldPath, newPath), ct));
        }
예제 #3
0
 public Task <FdbDirectorySubspace> TryMoveAsync([NotNull] IEnumerable <string> oldPath, [NotNull] IEnumerable <string> newPath, CancellationToken cancellationToken)
 {
     return(m_database.ReadWriteAsync((tr) => m_directory.TryMoveAsync(tr, oldPath, newPath), cancellationToken));
 }