diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs index e53ba5b9a6..4c3ede4ca8 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingHelper.cs @@ -36,7 +36,7 @@ namespace Volo.Abp.Auditing IClock clock, IAuditingStore auditingStore, ILogger logger, - IServiceProvider serviceProvider, + IServiceProvider serviceProvider, ICorrelationIdProvider correlationIdProvider) { Options = options.Value; @@ -77,9 +77,10 @@ namespace Volo.Abp.Auditing var classType = methodInfo.DeclaringType; if (classType != null) { - if (AuditingInterceptorRegistrar.ShouldAuditTypeByDefault(classType)) + var shouldAudit = AuditingInterceptorRegistrar.ShouldAuditTypeByDefaultOrNull(classType); + if (shouldAudit != null) { - return true; + return shouldAudit.Value; } } @@ -123,7 +124,7 @@ namespace Volo.Abp.Auditing return defaultValue; } - + public virtual AuditLogInfo CreateAuditLogInfo() { var auditInfo = new AuditLogInfo @@ -147,8 +148,8 @@ namespace Volo.Abp.Auditing public virtual AuditLogActionInfo CreateAuditLogAction( AuditLogInfo auditLog, - Type type, - MethodInfo method, + Type type, + MethodInfo method, object[] arguments) { return CreateAuditLogAction(auditLog, type, method, CreateArgumentsDictionary(method, arguments)); @@ -156,8 +157,8 @@ namespace Volo.Abp.Auditing public virtual AuditLogActionInfo CreateAuditLogAction( AuditLogInfo auditLog, - Type type, - MethodInfo method, + Type type, + MethodInfo method, IDictionary arguments) { var actionInfo = new AuditLogActionInfo @@ -240,4 +241,4 @@ namespace Volo.Abp.Auditing return dictionary; } } -} \ No newline at end of file +} diff --git a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs index a407335f3d..54607a55ca 100644 --- a/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs +++ b/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptorRegistrar.cs @@ -21,8 +21,8 @@ namespace Volo.Abp.Auditing { return false; } - - if (ShouldAuditTypeByDefault(type)) + + if (ShouldAuditTypeByDefaultOrNull(type) == true) { return true; } @@ -36,7 +36,7 @@ namespace Volo.Abp.Auditing } //TODO: Move to a better place - public static bool ShouldAuditTypeByDefault(Type type) + public static bool? ShouldAuditTypeByDefaultOrNull(Type type) { //TODO: In an inheritance chain, it would be better to check the attributes on the top class first. @@ -55,7 +55,7 @@ namespace Volo.Abp.Auditing return true; } - return false; + return null; } } -} \ No newline at end of file +}