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

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

            cancellation.ThrowIfCancellationRequested();
            return(this.connection.InsertOrReplaceAllAsync(entities, cancellation));
        }
Beispiel #3
0
        /// <inheritdoc />
        public async Task AddOrUpdateAllAsync <TEntity>(
            IEnumerable <TEntity> entities, CancellationToken cancellation = default(CancellationToken))
            where TEntity : class
        {
            IAsyncStoreContracts.AddOrUpdateAllAsync(entities);

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

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

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