diff --git a/CHANGELOG.md b/CHANGELOG.md index 379cfa497..ad9c36aa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - feat: better "not found" messages from data sources when the ID is null or empty string. (#447) - fix(template): adjust manual chunking configuration to avoid circular deps. (#455) +- fix(audit): key props now respect configured property exclusions # 5.0.1 diff --git a/src/IntelliTect.Coalesce.AuditLogging/Internal/CoalesceAudit.cs b/src/IntelliTect.Coalesce.AuditLogging/Internal/CoalesceAudit.cs index ed8afed26..c507feedb 100644 --- a/src/IntelliTect.Coalesce.AuditLogging/Internal/CoalesceAudit.cs +++ b/src/IntelliTect.Coalesce.AuditLogging/Internal/CoalesceAudit.cs @@ -59,7 +59,7 @@ internal void PreSaveChanges(DbContext context) audit.Entries.Add(auditEntry); auditEntry.Properties = item.Properties - .Where(p => p.Metadata.IsKey() || audit.Configuration.IsAuditedProperty(p)) + .Where(p => audit.Configuration.IsAuditedProperty(p)) .Select(p => new AuditEntryProperty { Parent = auditEntry, @@ -80,10 +80,10 @@ internal void PreSaveChanges(DbContext context) audit.Entries.Add(auditEntry); auditEntry.Properties = item.Properties - .Where(p => p.Metadata.IsKey() || ( + .Where(p => audit.Configuration.IsAuditedProperty(p) && !object.Equals(p.CurrentValue, p.OriginalValue) - )) + ) .Select(p => new AuditEntryProperty { Parent = auditEntry, @@ -106,7 +106,7 @@ internal void PostSaveChanges() case AuditEntryState.EntityAdded: foreach (var propertyEntry in auditEntry.Entry.Properties) { - if (!propertyEntry.Metadata.IsKey() && !auditEntry.Parent.Configuration.IsAuditedProperty(propertyEntry)) + if (!auditEntry.Parent.Configuration.IsAuditedProperty(propertyEntry)) { continue; }