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

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

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

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

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

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