Soenneker.Cosmos.Repositories.Audits
4.0.726
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Cosmos.Repositories.Audits --version 4.0.726
NuGet\Install-Package Soenneker.Cosmos.Repositories.Audits -Version 4.0.726
<PackageReference Include="Soenneker.Cosmos.Repositories.Audits" Version="4.0.726" />
<PackageVersion Include="Soenneker.Cosmos.Repositories.Audits" Version="4.0.726" />
<PackageReference Include="Soenneker.Cosmos.Repositories.Audits" />
paket add Soenneker.Cosmos.Repositories.Audits --version 4.0.726
#r "nuget: Soenneker.Cosmos.Repositories.Audits, 4.0.726"
#:package Soenneker.Cosmos.Repositories.Audits@4.0.726
#addin nuget:?package=Soenneker.Cosmos.Repositories.Audits&version=4.0.726
#tool nuget:?package=Soenneker.Cosmos.Repositories.Audits&version=4.0.726
Soenneker.Cosmos.Repositories.Audits
A Cosmos DB repository specialized for AuditDocument records stored in the audits container.
Installation
dotnet add package Soenneker.Cosmos.Repositories.Audits
Registration
using Soenneker.Cosmos.Repositories.Audits.Abstract;
using Soenneker.Cosmos.Repositories.Audits.Registrars;
services.AddAuditsRepositoryAsScoped();
IAuditsRepository audits = serviceProvider.GetRequiredService<IAuditsRepository>();
Use the scoped registration because the repository depends on scoped user context. AddAuditsRepositoryAsSingleton() remains for source compatibility but is obsolete and now also registers a scoped repository.
The registrar adds the background queue, user context, and Cosmos container dependencies. Configure the Cosmos dependencies under Azure:Cosmos as required by those packages.
Get an entity's audit history
List<AuditDocument> history = await audits.GetByEntity(
entityId,
cancellationToken);
entityId is used as the Cosmos partition key. The method returns every audit document in that partition; it does not apply additional ordering or pagination.
Mutation boundary
AddItem, the UpdateItem(id, ...) overload, and the DeleteItem(id, ...) overload are marked obsolete with compile-time errors and throw NotSupportedException from the concrete repository. Audit creation is expected to happen through the audit behavior in the general Cosmos repository rather than through this specialized repository.
This API is not an authorization boundary. IAuditsRepository inherits the broader ICosmosRepository<AuditDocument> contract, which includes other mutation operations. Do not expose the repository to untrusted callers; enforce write restrictions in the application and Cosmos account permissions.
The repository disables recursive audit generation for the audits container. Cosmos failures and cancellation propagate according to the underlying repository operation.
| 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
- Soenneker.Cosmos.Repository (>= 4.0.8186)
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 |
|---|---|---|
| 4.0.728 | 0 | 8/31/2026 |
| 4.0.727 | 0 | 8/31/2026 |
| 4.0.726 | 35 | 8/31/2026 |
| 4.0.725 | 42 | 8/30/2026 |
| 4.0.724 | 40 | 8/30/2026 |
| 4.0.723 | 56 | 8/30/2026 |
| 4.0.722 | 39 | 8/30/2026 |
| 4.0.721 | 37 | 8/30/2026 |
| 4.0.720 | 34 | 8/30/2026 |
| 4.0.719 | 38 | 8/29/2026 |
| 4.0.718 | 41 | 8/29/2026 |
| 4.0.717 | 34 | 8/29/2026 |
| 4.0.716 | 70 | 8/27/2026 |
| 4.0.715 | 79 | 8/27/2026 |
| 4.0.714 | 79 | 8/26/2026 |
| 4.0.713 | 71 | 8/26/2026 |
| 4.0.712 | 71 | 8/26/2026 |
| 4.0.711 | 65 | 8/26/2026 |
| 4.0.710 | 93 | 8/22/2026 |
| 4.0.709 | 83 | 8/22/2026 |
Update dependency Soenneker.Cosmos.Repository to 4.0.8186 (#1253)