EF.Toolkit.Audit.SqlServer
10.0.0-alpha.7
dotnet add package EF.Toolkit.Audit.SqlServer --version 10.0.0-alpha.7
NuGet\Install-Package EF.Toolkit.Audit.SqlServer -Version 10.0.0-alpha.7
<PackageReference Include="EF.Toolkit.Audit.SqlServer" Version="10.0.0-alpha.7" />
<PackageVersion Include="EF.Toolkit.Audit.SqlServer" Version="10.0.0-alpha.7" />
<PackageReference Include="EF.Toolkit.Audit.SqlServer" />
paket add EF.Toolkit.Audit.SqlServer --version 10.0.0-alpha.7
#r "nuget: EF.Toolkit.Audit.SqlServer, 10.0.0-alpha.7"
#:package EF.Toolkit.Audit.SqlServer@10.0.0-alpha.7
#addin nuget:?package=EF.Toolkit.Audit.SqlServer&version=10.0.0-alpha.7&prerelease
#tool nuget:?package=EF.Toolkit.Audit.SqlServer&version=10.0.0-alpha.7&prerelease
EF.Toolkit.Audit.SqlServer
The SQL Server provider for EF.Toolkit.Audit. Install this package rather than the core one: it brings the core with it and maps the audit table onto SQL Server types.
Install
dotnet add package EF.Toolkit.Audit.SqlServer
Setup
One call, after the provider:
services.AddDbContext<AppDb>(o => o
.UseSqlServer(connectionString)
.UseAuditing(a => a.Schema("audit")));
If you reference both provider packages, use UseSqlServerAuditing().
What this package provides
The audit table's shape is decided here. The columns that differ from PostgreSQL:
| Column | Type |
|---|---|
EntityType, EntityKey, ActorId, ActorName, ActorType, TenantId, Source |
nvarchar(256) |
OccurredAt |
datetimeoffset(7) |
CorrelationId |
uniqueidentifier |
Changes |
nvarchar(max) with CHECK (ISJSON(…) = 1) |
Indexing the payload
SQL Server has no index over a JSON document, so unlike PostgreSQL's jsonb, the payload here is
validated but not searchable in general. Make a specific path searchable with a persisted computed
column:
.UseSqlServerAuditing(a => a.IndexJsonPath("$.new.Status"))
That is a per-path decision rather than a blanket one — name the paths a query actually filters on.
Beyond that, entries are indexed by default on (EntityType, EntityKey, OccurredAt DESC) — the
history of one row — plus actor, correlation and tenant when multi-tenancy is configured.
Supported versions
SQL Server 2022, covered by the differential harness on every commit. 2019 and Azure SQL are likely
to work — ISJSON and persisted computed columns predate 2022 — but are not tested.
Full documentation
Everything else — registering entity types and properties, actors, ambient scopes, multi-tenancy, the payload format, options, diagnostics and limitations — is in the EF.Toolkit.Audit documentation.
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. |
-
net10.0
- EF.Toolkit.Audit (>= 10.0.0-alpha.7)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0 && < 11.0.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.0 && < 11.0.0)
- System.Security.Cryptography.Pkcs (>= 10.0.13)
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 |
|---|---|---|
| 10.0.0-alpha.7 | 74 | 10/18/2026 |
| 10.0.0-alpha.6 | 109 | 8/18/2026 |
| 10.0.0-alpha.5 | 90 | 8/15/2026 |
| 10.0.0-alpha.4 | 92 | 8/14/2026 |
| 10.0.0-alpha.3 | 84 | 8/14/2026 |