Intellivega.AuditLogs 1.0.0

Intellivega.AuditLogs

Reusable .NET 10 and EF Core 10 helpers for producing application audit records.

Features

  • Detect meaningful changes from an EF Core EntityEntry.
  • Ignore primary keys and application-managed properties.
  • Format primitive and structured values consistently.
  • Resolve composite entity identifiers.
  • Create audit entries with consistent user, organization, and UTC metadata.

Installation

Until the package is published to NuGet, reference the project directly:

<ProjectReference Include="path/to/Intellivega.AuditLogs/src/Intellivega.AuditLogs/Intellivega.AuditLogs.csproj" />

After publication:

dotnet add package Intellivega.AuditLogs

Usage

Detect changes on a tracked EF Core entity:

IReadOnlyList<AuditPropertyChange> changes =
    AuditChangeDetector.GetModifiedProperties(
        dbContext.Entry(entity),
        nameof(entity.Modified));

Create a consistently populated audit record:

AuditLogEntryFactory factory = new(
    currentUserId,
    currentUserName,
    organizationId,
    DateTime.UtcNow);

AuditLogEntry entry = factory.Create(
    entityName: "Invoice",
    entityId: invoice.Id.ToString(),
    action: "Updated",
    fallbackOrganizationId: invoice.OrganizationId,
    fieldName: change.PropertyName,
    oldValue: AuditValueFormatter.Format(change.OriginalValue),
    newValue: AuditValueFormatter.Format(change.CurrentValue));

The consuming application owns persistence and the EF configuration for AuditLogEntry.

Build and test

dotnet build Intellivega.AuditLogs.slnx
dotnet test Intellivega.AuditLogs.slnx
dotnet pack src/Intellivega.AuditLogs/Intellivega.AuditLogs.csproj

No packages depend on Intellivega.AuditLogs.

.NET 10.0

Version Downloads Last updated
1.0.0 145 09/10/2026