From bc8ea33ec7dd6538012dc017a06fcfc2c32ffcb9 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 18:10:56 +0300 Subject: [PATCH] Add BulkOperationProviders for both Db Provider - Related with #6654 --- .../IEfCoreBulkOperationProvider.cs | 20 ++++++++++ .../MongoDB/IMongoDbBulkOperationProvider.cs | 37 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs index 6ff6e2bdc0..55883cb9ad 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/IEfCoreBulkOperationProvider.cs @@ -16,5 +16,25 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore ) where TDbContext : IEfCoreDbContext where TEntity : class, IEntity; + + + Task UpdateManyAsync( + IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity; + + + Task DeleteManyAsync( + IEfCoreRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TDbContext : IEfCoreDbContext + where TEntity : class, IEntity; } } diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs new file mode 100644 index 0000000000..a4751839da --- /dev/null +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/IMongoDbBulkOperationProvider.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories.MongoDB; + +namespace Volo.Abp.MongoDB.Volo.Abp.Domain.Repositories.MongoDB +{ + public interface IMongoDbBulkOperationProvider + { + Task InsertManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + + + Task UpdateManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + + + Task DeleteManyAsync( + IMongoDbRepository repository, + IEnumerable entities, + bool autoSave, + CancellationToken cancellationToken + ) + where TEntity : class, IEntity; + } +}