Docs
Tenantry ProAPI reference

AuditEntry class

Namespace: Tenantry.Pro.EfCore.Audit · Package: Tenantry.Pro.EfCore · API reference

Represents a single audited entity change captured before an EF Core SaveChanges call.

public sealed record AuditEntry : IEquatable<AuditEntry>

Implements IEquatable<AuditEntry>.

Properties

Action

The type of change: insert, update, or delete.

public required AuditAction Action { get; init; }

Value: AuditAction

ChangedProperties

The names of properties that changed. For inserts and deletes this is all tracked properties; for updates it is only the modified properties.

public required IReadOnlySet<string> ChangedProperties { get; init; }

Value: IReadOnlySet<string>

NewValues

Property values after the change. Empty for AuditAction.Delete; populated for AuditAction.Insert (all properties) and AuditAction.Update (changed properties only).

public required IReadOnlyDictionary<string, object?> NewValues { get; init; }

Value: IReadOnlyDictionary<string, object>

OldValues

Property values before the change. Empty for AuditAction.Insert; populated for AuditAction.Update (changed properties only) and AuditAction.Delete (all properties).

public required IReadOnlyDictionary<string, object?> OldValues { get; init; }

Value: IReadOnlyDictionary<string, object>

PrimaryKey

A string representation of the entity's primary key value(s). Composite keys are comma-separated. null when no primary key is defined.

public required string? PrimaryKey { get; init; }

Value: string

TableName

The database table name mapped by the entity's EF Core metadata. Falls back to the entity CLR type name when the provider has no table mapping.

public required string TableName { get; init; }

Value: string

TenantId

The current tenant identifier, serialised as a string. null when no tenant scope is active (e.g. admin background jobs).

public required string? TenantId { get; init; }

Value: string

Timestamp

The UTC timestamp at which the audit entry was recorded.

public required DateTimeOffset Timestamp { get; init; }

Value: DateTimeOffset

On this page