KitStack.Audit.AspNetCore
0.1.5
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package KitStack.Audit.AspNetCore --version 0.1.5
NuGet\Install-Package KitStack.Audit.AspNetCore -Version 0.1.5
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="KitStack.Audit.AspNetCore" Version="0.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KitStack.Audit.AspNetCore" Version="0.1.5" />
<PackageReference Include="KitStack.Audit.AspNetCore" />
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 KitStack.Audit.AspNetCore --version 0.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KitStack.Audit.AspNetCore, 0.1.5"
#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 KitStack.Audit.AspNetCore@0.1.5
#: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=KitStack.Audit.AspNetCore&version=0.1.5
#tool nuget:?package=KitStack.Audit.AspNetCore&version=0.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
KitStack.Audit.AspNetCore
One-call wiring for KitStack.Audit. Binds AuditOptions, registers the EF Core capture source,
and selects a sink from configuration.
Setup
{
"Audit": {
"Sink": "efcore",
"EnforceAuditableSetting": true,
"Database": {
"ConnectionString": "Server=...;Database=Audit;...",
"DatabaseName": "Audit",
"CollectionName": "AuditTrails"
}
}
}
// efcore sink: supply your relational provider (driver lives in your app)
builder.Services.AddKitStackAudit<IAggregateRoot>(
builder.Configuration,
efSinkProvider: o => o.UseSqlServer(builder.Configuration.GetConnectionString("Audit")));
// mongo / fake sinks need no provider delegate:
// builder.Services.AddKitStackAudit(builder.Configuration);
// the current user (application-specific) and interceptor attachment are your responsibility:
builder.Services.AddScoped<IAuditContextAccessor, CurrentUserAuditContextAccessor>();
builder.Services.AddDbContext<AppDbContext>((sp, o) =>
{
o.UseSqlServer(connectionString);
o.AddInterceptors(sp.GetRequiredService<AuditSaveChangesInterceptor>());
});
// optional
builder.Services.AddKitStackAuditNarration();
builder.Services.AddHealthChecks().AddKitStackAudit();
Sink selection (Audit:Sink)
| Value | Sink | Needs |
|---|---|---|
efcore |
relational (EF Core) | efSinkProvider delegate (your DB driver) |
mongo |
MongoDB | Audit:Database:ConnectionString + DatabaseName |
fake |
in-memory (KitStack.Audit.Fakes) |
nothing |
License
Apache-2.0
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- KitStack.Audit.Abstractions (>= 0.1.5)
- KitStack.Audit.Fakes (>= 0.1.5)
- KitStack.Audit.Sinks.EntityFrameworkCore (>= 0.1.5)
- KitStack.Audit.Sinks.Mongo (>= 0.1.5)
- Microsoft.EntityFrameworkCore (>= 10.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.8)
- MongoDB.Bson (>= 3.9.0)
- MongoDB.Driver (>= 3.9.0)
- MongoDB.EntityFrameworkCore (>= 10.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.