MinimalCleanArch.Audit
0.1.18
dotnet add package MinimalCleanArch.Audit --version 0.1.18
NuGet\Install-Package MinimalCleanArch.Audit -Version 0.1.18
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="MinimalCleanArch.Audit" Version="0.1.18" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalCleanArch.Audit" Version="0.1.18" />
<PackageReference Include="MinimalCleanArch.Audit" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MinimalCleanArch.Audit --version 0.1.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MinimalCleanArch.Audit, 0.1.18"
#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.
#:package MinimalCleanArch.Audit@0.1.18
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MinimalCleanArch.Audit&version=0.1.18
#tool nuget:?package=MinimalCleanArch.Audit&version=0.1.18
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MinimalCleanArch.Audit
Audit logging components for MinimalCleanArch.
Version
- Current stable: 0.1.18 (net9.0, net10.0).
Why Use It
- persist entity change history and audit metadata without duplicating audit plumbing in each EF Core DbContext
- query audit history by user, tenant, correlation ID, and other operational criteria
- bridge MCA execution-context data into audit logging automatically when available
When to Use It
- use it when the application needs traceability, compliance history, or administrative audit views
- keep it in infrastructure, near EF Core and persistence concerns
- skip it in small applications where audit storage is unnecessary overhead
Dependency Direction
- Depends on:
MinimalCleanArch - Typically referenced by: infrastructure projects
- Used by: API/host projects indirectly through infrastructure registration
- Do not reference from: domain projects
What's included
- Audit logging services and helpers.
- DI extensions to plug audit logging into your MinimalCleanArch app.
- Tenant-aware audit context support through
IAuditContextProvider. - Audit query service support for user, tenant, correlation ID, and flexible search queries.
- default audit-context bridging from
IExecutionContextwhen available
Usage
dotnet add package MinimalCleanArch.Audit --version 0.1.18
Register services:
builder.Services.AddAuditLogging();
builder.Services.AddAuditLogService<AppDbContext>();
If IExecutionContext is registered, AddAuditLogging() uses it automatically. Existing IAuditContextProvider customizations still work.
Configure the DbContext:
builder.Services.AddDbContext<AppDbContext>((sp, options) =>
{
options.UseSqlite("Data Source=app.db");
options.UseAuditInterceptor(sp);
});
Configure the audit model:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.UseAuditLog();
}
Implement a custom context provider when you need tenant-aware auditing:
public sealed class AppAuditContextProvider : IAuditContextProvider
{
public string? GetUserId() => "...";
public string? GetUserName() => "...";
public string? GetTenantId() => "...";
public string? GetCorrelationId() => "...";
public string? GetClientIpAddress() => "...";
public string? GetUserAgent() => "...";
public IDictionary<string, object>? GetMetadata() => null;
}
Notes:
TenantIdis a first-class field onAuditLog, so tenant filtering does not need to be pushed into metadata.IAuditLogServicesupports tenant-aware queries in addition to user and correlation-based lookups.IAuditContextProvider.GetTenantId()now defaults tonull, so existing custom providers do not need to implement tenant support immediately.- When using a local feed, add a
nuget.configpointing to your local packages folder and keepnuget.orgavailable unless your feed mirrors all external dependencies.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.3)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.3)
- MinimalCleanArch (>= 0.1.18)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.5)
- MinimalCleanArch (>= 0.1.18)
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.1.18 | 0 | 3/13/2026 |
| 0.1.18-preview | 27 | 3/12/2026 |
| 0.1.17 | 46 | 3/12/2026 |
| 0.1.17-preview | 81 | 3/8/2026 |
| 0.1.16-preview | 74 | 3/7/2026 |
| 0.1.15-preview | 79 | 3/3/2026 |
| 0.1.14 | 94 | 3/2/2026 |
| 0.1.14-preview | 82 | 3/1/2026 |
| 0.1.13-preview | 83 | 2/28/2026 |
| 0.1.12-preview | 92 | 2/22/2026 |
| 0.1.11-preview | 96 | 12/27/2025 |
| 0.1.10-preview | 95 | 12/27/2025 |
| 0.1.9-preview | 124 | 12/21/2025 |
| 0.1.8-preview | 233 | 12/15/2025 |
| 0.1.7 | 158 | 12/14/2025 |
| 0.1.7-preview | 413 | 12/11/2025 |
| 0.1.6 | 442 | 12/9/2025 |
| 0.1.6-preview | 474 | 12/9/2025 |