示例#1
0
        /// <inheritdoc />
        public async Task RemoveAllAsync(
            IEnumerable <TEntity> entities, CancellationToken cancellation = default(CancellationToken))
        {
            IAsyncStoreContracts.RemoveAllAsync(entities);

            cancellation.ThrowIfCancellationRequested();
            await this.store.RemoveAllAsync(entities, cancellation).DontMarshallContext();
        }
        /// <inheritdoc />
        public Task RemoveAllAsync <TEntity>(
            IEnumerable <TEntity> entities, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAllAsync(entities);

            cancellation.ThrowIfCancellationRequested();
            return(this.RunInTransactionAsync(transaction => transaction.RemoveAll(entities), cancellation));
        }
示例#3
0
        /// <inheritdoc />
        public async Task RemoveAllAsync <TEntity>(
            IEnumerable <TEntity> entities, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAllAsync(entities);

            var store = await this.GetStoreAsync <TEntity>(cancellation).DontMarshallContext();

            await store.RemoveAllAsync(entities, cancellation).DontMarshallContext();
        }
        /// <inheritdoc />
        public async Task RemoveAllAsync <TEntity>(
            IEnumerable <TEntity> entities, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAllAsync(entities);

            cancellation.ThrowIfCancellationRequested();
            using (await this.Lock.WriterLockAsync(cancellation).DontMarshallContext())
            {
                cancellation.ThrowIfCancellationRequested();
                await this.store.RemoveAllAsync(entities, cancellation).DontMarshallContext();
            }
        }