Linger.Audit
2.0.0-preview.1
dotnet add package Linger.Audit --version 2.0.0-preview.1
NuGet\Install-Package Linger.Audit -Version 2.0.0-preview.1
<PackageReference Include="Linger.Audit" Version="2.0.0-preview.1" />
<PackageVersion Include="Linger.Audit" Version="2.0.0-preview.1" />
<PackageReference Include="Linger.Audit" />
paket add Linger.Audit --version 2.0.0-preview.1
#r "nuget: Linger.Audit, 2.0.0-preview.1"
#:package Linger.Audit@2.0.0-preview.1
#addin nuget:?package=Linger.Audit&version=2.0.0-preview.1&prerelease
#tool nuget:?package=Linger.Audit&version=2.0.0-preview.1&prerelease
Linger.Audit
Breaking changes and 2.0 migration notes are documented in the Linger migration guide.
A lightweight .NET auditing library that provides base classes and interfaces for entity auditing.
📖 Table of Contents
- ✨ Features
- 📦 Installation
- 🚀 Quick Start
- Persistence Integration
- 🧩 Class Diagram Overview
- 📋 Interface and Base Class Reference
- 📜 License
✨ Features
- Multi-target framework support (.NET 9.0/.NET 8.0/.NET 6.0/NetStandard 2.0)
- Full audit trail tracking (creation, modification, deletion)
- Generic entity support with type-safe IDs
- Soft delete capability
- Built-in audit timestamps and user tracking
- Nullable reference types enabled
- MIT licensed
📦 Installation
From Visual Studio
- Open the
Solution Explorer - Right-click on your project
- Select
Manage NuGet Packages... - Click the
Browsetab and search for "Linger.Audit" - Click
Install
Package Manager Console
Install-Package Linger.Audit
.NET CLI
dotnet add package Linger.Audit
🚀 Quick Start
Basic Entities
Inherit from base entity classes to get ID properties:
// Simple entity with Guid ID type
public class Product : BaseEntity<Guid>
{
public string Name { get; set; } = null!;
public decimal Price { get; set; }
public string Description { get; set; } = null!;
}
// Entity with int ID type
public class Category : BaseEntity<int>
{
public string Name { get; set; } = null!;
}
// Entity with string ID type
public class Tag : BaseEntity<string>
{
public string Value { get; set; } = null!;
}
Creation Audit Entities
Track creation time and creator:
// Record when and who created a comment
public class Comment : CreationAuditEntity<Guid>
{
public string Text { get; set; } = null!;
public Guid ProductId { get; set; }
// Inherited properties:
// public string CreatorId { get; set; }
// public DateTimeOffset CreationTime { get; set; }
}
Full Audit Entities
Track creation, modification, and deletion information:
// User entity with full audit tracking
public class User : FullAuditEntity<Guid>
{
public string Username { get; set; } = null!;
public string Email { get; set; } = null!;
// Inherited properties:
// Creation
// public string CreatorId { get; set; }
// public DateTimeOffset CreationTime { get; set; }
// Modification
// public string? LastModifierId { get; set; }
// public DateTimeOffset? LastModificationTime { get; set; }
// Deletion
// public bool? IsDeleted { get; set; }
// public string? DeleterId { get; set; }
// public DateTimeOffset? DeletionTime { get; set; }
}
Persistence Integration
Linger.Audit only defines audit contracts and entity base classes. It does not hook into a persistence framework or populate fields automatically.
For EF Core, use Linger.EFCore.Audit. Its AuditEntitiesSaveChangesInterceptor populates creation, modification, deletion, and user fields while converting deletes of ISoftDelete entities into updates. Configure the optional soft-delete query filter as shown in the Linger.EFCore global query filter documentation.
Applications using another persistence technology should populate the same contracts in their own save pipeline.
For legacy database column types and DateTimeOffset conversions, see the advanced configuration section in Linger.EFCore.Audit.
📊 Class Diagram Overview
Relationships between main classes and interfaces:
BaseEntity<T>
|
├─ CreationAuditEntity<T>
| |
| ├─ AuditEntity<T>
| | |
| | └─ FullAuditEntity<T>
| |
| └─ [Custom Entity]
|
└─ [Custom Entity]
📋 Interface and Base Class Reference
IEntity<T> Interface
Defines an entity with typed ID:
public interface IEntity<T> : IEntity
{
T Id { get; set; }
}
ISoftDelete Interface
Enables soft delete functionality:
public interface ISoftDelete
{
bool? IsDeleted { get; set; }
}
BaseEntity Class
Base class for entities:
public abstract class BaseEntity<T> : IEntity<T>
{
public T Id { get; set; } = default!;
}
CreationAuditEntity Class
Base class that tracks creation information:
public abstract class CreationAuditEntity : ICreationAuditEntity
{
public string CreatorId { get; set; }
public DateTimeOffset CreationTime { get; set; }
}
AuditEntity Class
Base class that tracks creation and modification information:
public abstract class AuditEntity : CreationAuditEntity, IModificationAuditEntity
{
public string? LastModifierId { get; set; }
public DateTimeOffset? LastModificationTime { get; set; }
}
FullAuditEntity Class
Base class that tracks creation, modification, and deletion information:
public abstract class FullAuditEntity : AuditEntity, ISoftDelete
{
public bool? IsDeleted { get; set; }
public string? DeleterId { get; set; }
public DateTimeOffset? DeletionTime { get; set; }
}
📄 License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Linger.Audit:
| Package | Downloads |
|---|---|
|
Linger.EFCore.Audit
An Entity Framework Core audit trail library for automatically tracking data changes. Captures entity creation, modification, and deletion events with old and new values. Provides configurable audit logging with support for user tracking and timestamping. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.1 | 61 | 8/29/2026 |
| 1.6.4 | 111 | 8/16/2026 |
| 1.6.3 | 123 | 8/5/2026 |
| 1.6.2 | 138 | 8/2/2026 |
| 1.6.0 | 139 | 7/25/2026 |
| 1.5.5 | 122 | 7/23/2026 |
| 1.5.4-preview | 112 | 7/21/2026 |
| 1.5.3-preview | 121 | 7/20/2026 |
| 1.5.2-preview | 121 | 7/19/2026 |
| 1.5.1-preview | 114 | 7/15/2026 |
| 1.5.0-preview | 115 | 7/14/2026 |
| 1.4.4-preview | 128 | 6/16/2026 |
| 1.4.3-preview | 119 | 6/15/2026 |
| 1.4.2 | 131 | 5/20/2026 |
| 1.4.1-preview | 127 | 5/12/2026 |
| 1.4.0 | 125 | 5/6/2026 |
| 1.3.3-preview | 118 | 5/5/2026 |
| 1.3.2-preview | 132 | 4/29/2026 |
| 1.3.1-preview | 124 | 4/28/2026 |
| 1.3.0-preview | 120 | 4/27/2026 |