コード例 #1
0
        /// <inheritdoc />
        public async Task RemoveAsync(TEntity entity, CancellationToken cancellation = default(CancellationToken))
        {
            IAsyncStoreContracts.RemoveAsync(entity);

            cancellation.ThrowIfCancellationRequested();
            await this.store.RemoveAsync(entity, cancellation).DontMarshallContext();
        }
コード例 #2
0
        /// <inheritdoc />
        public Task RemoveAsync <TEntity>(
            TEntity entity, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAsync(entity);

            cancellation.ThrowIfCancellationRequested();
            return(this.connection.DeleteAsync(entity, cancellation));
        }
コード例 #3
0
        /// <inheritdoc />
        public async Task RemoveAsync <TEntity>(
            TEntity entity, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAsync(entity);

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

            await store.RemoveAsync(entity, cancellation).DontMarshallContext();
        }
コード例 #4
0
        /// <inheritdoc />
        public async Task RemoveAsync <TEntity>(
            TEntity entity, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.RemoveAsync(entity);

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