Browse Source
Merge pull request #19240 from abpframework/auto-merge/rel-8-1/2563
Merge branch dev with rel-8.1
pull/19244/head
maliming
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
15 additions and
5 deletions
-
framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs
|
|
|
@ -507,11 +507,21 @@ public class MongoDbRepository<TMongoDbContext, TEntity> |
|
|
|
var dbContext = await GetDbContextAsync(cancellationToken); |
|
|
|
var collection = dbContext.Collection<TEntity>(); |
|
|
|
|
|
|
|
await collection.DeleteManyAsync( |
|
|
|
dbContext.SessionHandle, |
|
|
|
Builders<TEntity>.Filter.Where(predicate), |
|
|
|
cancellationToken: cancellationToken |
|
|
|
); |
|
|
|
if (dbContext.SessionHandle != null) |
|
|
|
{ |
|
|
|
await collection.DeleteManyAsync( |
|
|
|
dbContext.SessionHandle, |
|
|
|
Builders<TEntity>.Filter.Where(predicate), |
|
|
|
cancellationToken: cancellationToken |
|
|
|
); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
await collection.DeleteManyAsync( |
|
|
|
Builders<TEntity>.Filter.Where(predicate), |
|
|
|
cancellationToken: cancellationToken |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Obsolete("Use GetQueryableAsync method.")] |
|
|
|
|