Browse Source

Add cancellationToken parameter to DeleteManyAsync

pull/7463/head
liangshiwei 6 years ago
parent
commit
2afbef110f
  1. 16
      framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs

16
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( updateResult = await collection.UpdateManyAsync(
dbContext.SessionHandle, dbContext.SessionHandle,
CreateEntitiesFilter(entityArray), CreateEntitiesFilter(entityArray),
Builders<TEntity>.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) Builders<TEntity>.Update.Set(x => ((ISoftDelete)x).IsDeleted, true),
); cancellationToken: cancellationToken);
} }
else else
{ {
updateResult = await collection.UpdateManyAsync( updateResult = await collection.UpdateManyAsync(
CreateEntitiesFilter(entityArray), CreateEntitiesFilter(entityArray),
Builders<TEntity>.Update.Set(x => ((ISoftDelete)x).IsDeleted, true) Builders<TEntity>.Update.Set(x => ((ISoftDelete)x).IsDeleted, true),
); cancellationToken: cancellationToken);
} }
if (updateResult.MatchedCount < entitiesCount) if (updateResult.MatchedCount < entitiesCount)
@ -368,14 +368,14 @@ namespace Volo.Abp.Domain.Repositories.MongoDB
{ {
deleteResult = await collection.DeleteManyAsync( deleteResult = await collection.DeleteManyAsync(
dbContext.SessionHandle, dbContext.SessionHandle,
CreateEntitiesFilter(entityArray) CreateEntitiesFilter(entityArray),
); cancellationToken: cancellationToken);
} }
else else
{ {
deleteResult = await collection.DeleteManyAsync( deleteResult = await collection.DeleteManyAsync(
CreateEntitiesFilter(entityArray) CreateEntitiesFilter(entityArray),
); cancellationToken);
} }
if (deleteResult.DeletedCount < entitiesCount) if (deleteResult.DeletedCount < entitiesCount)

Loading…
Cancel
Save