From 2afbef110fed6b25ae736687d054ca694c714790 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Tue, 26 Jan 2021 17:15:10 +0800 Subject: [PATCH] Add cancellationToken parameter to DeleteManyAsync --- .../Repositories/MongoDB/MongoDbRepository.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index b252c48999..fcb51a687c 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -345,15 +345,15 @@ namespace Volo.Abp.Domain.Repositories.MongoDB updateResult = await collection.UpdateManyAsync( dbContext.SessionHandle, CreateEntitiesFilter(entityArray), - Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) - ); + Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true), + cancellationToken: cancellationToken); } else { updateResult = await collection.UpdateManyAsync( CreateEntitiesFilter(entityArray), - Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) - ); + Builders.Update.Set(x => ((ISoftDelete)x).IsDeleted, true), + cancellationToken: cancellationToken); } if (updateResult.MatchedCount < entitiesCount) @@ -368,14 +368,14 @@ namespace Volo.Abp.Domain.Repositories.MongoDB { deleteResult = await collection.DeleteManyAsync( dbContext.SessionHandle, - CreateEntitiesFilter(entityArray) - ); + CreateEntitiesFilter(entityArray), + cancellationToken: cancellationToken); } else { deleteResult = await collection.DeleteManyAsync( - CreateEntitiesFilter(entityArray) - ); + CreateEntitiesFilter(entityArray), + cancellationToken); } if (deleteResult.DeletedCount < entitiesCount)