From 7dbc4fd460691b9c749987c02e6fb80db16a898b Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 26 May 2022 10:56:28 +0800 Subject: [PATCH 1/2] Add missing condition for UpdatManyAsync --- .../Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 388330e69a..e0c4c531c4 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 @@ -231,7 +231,7 @@ public class MongoDbRepository { SetModificationAuditProperties(entity); - var isSoftDeleteEntity = typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity)); + var isSoftDeleteEntity = entity is ISoftDelete softDeleteEntity && softDeleteEntity.IsDeleted; if (isSoftDeleteEntity) { SetDeletionAuditProperties(entity); From bc7d3cedc9266254768f05a49ec5484504285daa Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Thu, 26 May 2022 10:59:18 +0800 Subject: [PATCH 2/2] rename isSoftDeleteEntity to isEntityDeleted --- .../Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 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 e0c4c531c4..4f7b985faa 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 @@ -231,8 +231,8 @@ public class MongoDbRepository { SetModificationAuditProperties(entity); - var isSoftDeleteEntity = entity is ISoftDelete softDeleteEntity && softDeleteEntity.IsDeleted; - if (isSoftDeleteEntity) + var isEntityDeleted = entity is ISoftDelete softDeleteEntity && softDeleteEntity.IsDeleted; + if (isEntityDeleted) { SetDeletionAuditProperties(entity); TriggerEntityDeleteEvents(entity);