[CHANGE] Fixes library db

This commit is contained in:
max
2025-09-28 18:59:39 +02:00
parent a2a420d596
commit b8d2573d78
3 changed files with 5 additions and 34 deletions

View File

@@ -82,7 +82,7 @@ public class AuditInterceptor : SaveChangesInterceptor
EntityName = entry.Entity.GetType().Name,
EntityId = primaryKey ?? "Unknown",
PropertyName = prop.Metadata.Name,
OldValue = SerializeValue(prop.OriginalValue),
OldValue = changeType == EntityState.Added ? null : SerializeValue(prop.OriginalValue),
NewValue = SerializeValue(prop.CurrentValue),
ModifiedUtc = DateTime.UtcNow,
ChangedBy = "SYSTEM",