From 5616252f7403fd858ec4a133c2ee5bffd5fda88e Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 3 Mar 2020 15:15:47 +0800 Subject: [PATCH] Save audit logs even if no action performed in the request. Resolve #2820 --- .../Volo/Abp/Auditing/AuditingManager.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs index 2a9dd8bf5a0..8cc9fb76758 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingManager.cs @@ -114,20 +114,7 @@ protected virtual async Task SaveAsync(DisposableSaveHandle saveHandle) { BeforeSave(saveHandle); - if (ShouldSave(saveHandle.AuditLog)) - { - await _auditingStore.SaveAsync(saveHandle.AuditLog); - } - } - - protected bool ShouldSave(AuditLogInfo auditLog) - { - if (!auditLog.Actions.Any() && !auditLog.EntityChanges.Any()) - { - return false; - } - - return true; + await _auditingStore.SaveAsync(saveHandle.AuditLog); } protected class DisposableSaveHandle : IAuditLogSaveHandle