Soenneker.Cosmos.Repositories.Audits
11.0.894
Prefix Reserved
dotnet add package Soenneker.Cosmos.Repositories.Audits --version 11.0.894
NuGet\Install-Package Soenneker.Cosmos.Repositories.Audits -Version 11.0.894
<PackageReference Include="Soenneker.Cosmos.Repositories.Audits" Version="11.0.894" />
<PackageVersion Include="Soenneker.Cosmos.Repositories.Audits" Version="11.0.894" />
<PackageReference Include="Soenneker.Cosmos.Repositories.Audits" />
paket add Soenneker.Cosmos.Repositories.Audits --version 11.0.894
#r "nuget: Soenneker.Cosmos.Repositories.Audits, 11.0.894"
#:package Soenneker.Cosmos.Repositories.Audits@11.0.894
#addin nuget:?package=Soenneker.Cosmos.Repositories.Audits&version=11.0.894
#tool nuget:?package=Soenneker.Cosmos.Repositories.Audits&version=11.0.894
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 | net11.0 is compatible. |
-
net11.0
- Soenneker.Cosmos.Repository (>= 11.0.8497)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Cosmos.Repositories.Audits:
| Package | Downloads |
|---|---|
|
Soenneker.Librarian.Cosmos
Librarian native document storage backed by Cosmos with server queries and atomic batches. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.894 | 0 | 11/8/2026 |
| 11.0.893 | 0 | 11/7/2026 |
| 11.0.892 | 0 | 11/7/2026 |
| 11.0.891 | 42 | 11/7/2026 |
| 11.0.890 | 48 | 11/7/2026 |
| 11.0.889 | 50 | 11/6/2026 |
| 11.0.888 | 256 | 11/3/2026 |
| 11.0.887 | 85 | 11/3/2026 |
| 11.0.886 | 97 | 11/3/2026 |
| 11.0.885 | 92 | 11/3/2026 |
| 11.0.884 | 125 | 11/3/2026 |
| 11.0.883 | 92 | 11/3/2026 |
| 11.0.882 | 105 | 11/3/2026 |
| 11.0.881 | 300 | 10/30/2026 |
| 11.0.880 | 135 | 10/29/2026 |
| 11.0.879 | 94 | 10/29/2026 |
| 11.0.878 | 107 | 10/28/2026 |
| 11.0.877 | 166 | 10/27/2026 |
| 11.0.876 | 91 | 10/27/2026 |
| 11.0.875 | 92 | 10/27/2026 |
Update dependency Soenneker.Cosmos.Repository to 11.0.8497 (#1424)