From 4e4b2454c02298ecb9ff95d3401046971d1725e1 Mon Sep 17 00:00:00 2001 From: enisn Date: Tue, 15 Dec 2020 17:48:56 +0300 Subject: [PATCH] Add Bulk Operation method to IBasicRepository - Related with #6654 --- .../Domain/Repositories/IBasicRepository.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs index 0637225229..24ec027b06 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IBasicRepository.cs @@ -21,6 +21,16 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task InsertAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + /// + /// Inserts multiple new entities. + /// + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// + /// A to observe while waiting for the task to complete. + /// Entities to be inserted. + /// Awaitable . Task InsertManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); /// @@ -35,6 +45,17 @@ namespace Volo.Abp.Domain.Repositories [NotNull] Task UpdateAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + /// + /// Updates multiple entities. + /// + /// Entities to be updated. + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// A to observe while waiting for the task to complete. + /// Awaitable . + + Task UpdateManyAsync(IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); /// /// Deletes an entity. /// @@ -45,6 +66,18 @@ namespace Volo.Abp.Domain.Repositories /// /// A to observe while waiting for the task to complete. Task DeleteAsync([NotNull] TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default); + + /// + /// Deletes multiple entities. + /// + /// Entities to be deleted. + /// + /// Set true to automatically save changes to database. + /// This is useful for ORMs / database APIs those only save changes with an explicit method call, but you need to immediately save changes to the database. + /// + /// A to observe while waiting for the task to complete. + /// Awaitable . + Task DeleteManyAsync([NotNull] IEnumerable entities, bool autoSave = false, CancellationToken cancellationToken = default); } public interface IBasicRepository : IBasicRepository, IReadOnlyBasicRepository