Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore
3.0.129
See the version list below for details.
dotnet add package Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore --version 3.0.129
NuGet\Install-Package Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore -Version 3.0.129
<PackageReference Include="Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore" Version="3.0.129" />
<PackageVersion Include="Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore" Version="3.0.129" />
<PackageReference Include="Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore" />
paket add Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore --version 3.0.129
#r "nuget: Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore, 3.0.129"
#:package Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore@3.0.129
#addin nuget:?package=Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore&version=3.0.129
#tool nuget:?package=Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore&version=3.0.129
Innovabit.DotNet.Interceptors.Audit.EntityFrameworkCore
Entity Framework Core sink for
Innovabit.DotNet.Interceptors.Audit.Abstractions:
every [Audited] call becomes an AuditRecord row in your database.
Usage
// A factory, not just AddDbContext — see "Why a separate context" below.
services.AddDbContextFactory<BillingDbContext>(o => o.UseSqlServer(connectionString));
services
.AddInterceptors()
.AddEntityFrameworkCoreAudit<BillingDbContext>();
services.AddScopedWithInterception<IRefundService, RefundService>();
Add the table to your model and create a migration for it:
public class BillingDbContext(DbContextOptions<BillingDbContext> options) : DbContext(options)
{
protected override void OnModelCreating(ModelBuilder modelBuilder)
=> modelBuilder.ApplyAuditRecordConfiguration();
}
dotnet ef migrations add AddAuditRecords
Why a separate context
Each entry is written on a context taken from IDbContextFactory<TContext>, not on the context the
audited method happens to be using. That is what makes the trail trustworthy:
- The audit row survives a rollback of the business transaction. A refund that failed halfway still leaves a record that it was attempted — which is precisely the case an auditor asks about.
- Auditing cannot flush the caller's pending work. Saving on a shared context would persist whatever half-finished changes were sitting in its change tracker, as a side effect of writing an audit row.
The factory can live alongside a regular AddDbContext<TContext>(); registering both is normal.
The table
AuditRecords, with indexes on OccurredAt and Action — the two things an audit trail is always
queried by.
| Column | Notes |
|---|---|
Id |
Surrogate key, database-generated. |
OccurredAt |
When the call started. |
Action, Category |
From [Audited], or TypeName.MethodName. |
TypeName, MethodName |
What was called. |
Subject |
Who did it, from IAuditSubjectAccessor. |
CorrelationId |
Trace id of the ambient Activity, to line the row up with a trace. |
Succeeded, ExceptionType, ExceptionMessage |
How it ended. |
DurationMs |
How long it took. |
Arguments, Result |
Serialized by the registered IAuditSerializer (JSON by default). |
Arguments, Result and ExceptionMessage are deliberately unbounded; the rest carry lengths.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net11.0 is compatible. |
-
net10.0
- Innovabit.DotNet.Interceptors.Audit.Abstractions (>= 3.0.129)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.15)
-
net11.0
- Innovabit.DotNet.Interceptors.Audit.Abstractions (>= 3.0.129)
- Microsoft.EntityFrameworkCore.Relational (>= 11.0.0)
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 |
|---|---|---|
| 3.0.136 | 51 | 12/5/2026 |
| 3.0.135 | 105 | 11/30/2026 |
| 3.0.134 | 88 | 11/30/2026 |
| 3.0.133 | 95 | 11/30/2026 |
| 3.0.132 | 95 | 11/30/2026 |
| 3.0.129 | 82 | 11/30/2026 |
| 3.0.128 | 92 | 11/30/2026 |
| 3.0.127 | 108 | 11/30/2026 |
| 3.0.126 | 99 | 11/30/2026 |
| 3.0.125 | 98 | 11/30/2026 |
| 3.0.124 | 102 | 11/28/2026 |
| 3.0.123 | 93 | 11/28/2026 |
| 3.0.122 | 118 | 11/21/2026 |
| 2.0.121 | 95 | 11/21/2026 |
| 2.0.120 | 97 | 11/21/2026 |
| 2.0.119 | 116 | 11/14/2026 |
| 2.0.118 | 114 | 11/7/2026 |
| 2.0.117 | 125 | 10/31/2026 |
| 2.0.116 | 114 | 10/26/2026 |
| 2.0.115 | 122 | 10/17/2026 |