Esempio n. 1
0
        /// <inheritdoc />
        public async Task UpdateAsync(TEntity entity, CancellationToken cancellation = default(CancellationToken))
        {
            IAsyncStoreContracts.UpdateAsync(entity);

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

            cancellation.ThrowIfCancellationRequested();
            return(this.connection.UpdateAsync(entity, cancellation));
        }
Esempio n. 3
0
        /// <inheritdoc />
        public async Task UpdateAsync <TEntity>(
            TEntity entity, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.UpdateAsync(entity);

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

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

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