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" />
                    
Directory.Packages.props
<PackageReference Include="MinimalCleanArch.Audit" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=MinimalCleanArch.Audit&version=0.1.18
                    
Install as a Cake Tool

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 IExecutionContext when 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:

  • TenantId is a first-class field on AuditLog, so tenant filtering does not need to be pushed into metadata.
  • IAuditLogService supports tenant-aware queries in addition to user and correlation-based lookups.
  • IAuditContextProvider.GetTenantId() now defaults to null, so existing custom providers do not need to implement tenant support immediately.
  • When using a local feed, add a nuget.config pointing to your local packages folder and keep nuget.org available unless your feed mirrors all external dependencies.
Product 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.

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