Linger.EFCore.Audit 0.2.0-alpha

This is a prerelease version of Linger.EFCore.Audit.
dotnet add package Linger.EFCore.Audit --version 0.2.0-alpha                
NuGet\Install-Package Linger.EFCore.Audit -Version 0.2.0-alpha                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Linger.EFCore.Audit" Version="0.2.0-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Linger.EFCore.Audit --version 0.2.0-alpha                
#r "nuget: Linger.EFCore.Audit, 0.2.0-alpha"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Linger.EFCore.Audit as a Cake Addin
#addin nuget:?package=Linger.EFCore.Audit&version=0.2.0-alpha&prerelease

// Install Linger.EFCore.Audit as a Cake Tool
#tool nuget:?package=Linger.EFCore.Audit&version=0.2.0-alpha&prerelease                

Linger.EFCore.Audit

An Entity Framework Core audit trail library for automatically tracking data changes.

✨ Features

  • Automatic audit logging for Entity Framework Core operations
  • Tracks entity creation, modification, and deletion
  • Captures old and new values for changed properties
  • Records user information for each change
  • Supports soft delete
  • Built-in JSON serialization for audit data
  • Compatible with EF Core 9.0 and 8.0

📦 Installation

From Visual Studio

  1. Open the Solution Explorer.
  2. Right-click on a project within your solution.
  3. Click on Manage NuGet Packages....
  4. Click on the Browse tab and search for "Linger.EFCore.Audit".
  5. Click on the Linger.EFCore.Audit package, select the appropriate version and click Install.

Package Manager Console

PM> Install-Package Linger.EFCore.Audit

.NET CLI Console

> dotnet add package Linger.EFCore.Audit

🚀 Quick Start

// 1. Add audit trail to your DbContext 
public class AppDbContext : DbContext 
{ 
    protected override void OnModelCreating(ModelBuilder modelBuilder) 
    { 
        modelBuilder.ApplyAudit(); // Apply audit configurations 
    } 
}

// 2. Register the audit interceptor 
services.AddDbContext(options => { options.AddInterceptors(sp => new AuditEntitiesSaveChangesInterceptor( sp.GetRequiredService() )); });

📄 Audit Trail Data

The AuditTrailEntry captures:

  • Entity name and ID
  • Type of change (Added/Modified/Deleted)
  • Username performing the change
  • Timestamp
  • Old and new property values
  • List of modified columns

🔍 Automatic Tracking

  • Creation audit: CreatorId, CreationTime
  • Modification audit: LastModifierId, LastModificationTime
  • Soft delete: IsDeleted, DeleterId, DeletionTime

📝 License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0-alpha 38 2/9/2025