Anarchy.Toolkit.Infrastructure.Persistence.Db.Events
1.0.0
See the version list below for details.
dotnet add package Anarchy.Toolkit.Infrastructure.Persistence.Db.Events --version 1.0.0
NuGet\Install-Package Anarchy.Toolkit.Infrastructure.Persistence.Db.Events -Version 1.0.0
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Events" Version="1.0.0" />
<PackageVersion Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Events" Version="1.0.0" />
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Events" />
paket add Anarchy.Toolkit.Infrastructure.Persistence.Db.Events --version 1.0.0
#r "nuget: Anarchy.Toolkit.Infrastructure.Persistence.Db.Events, 1.0.0"
#:package Anarchy.Toolkit.Infrastructure.Persistence.Db.Events@1.0.0
#addin nuget:?package=Anarchy.Toolkit.Infrastructure.Persistence.Db.Events&version=1.0.0
#tool nuget:?package=Anarchy.Toolkit.Infrastructure.Persistence.Db.Events&version=1.0.0
Anarchy.Toolkit.Infrastructure.Persistence.Db.Events
Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Infrastructure · Package catalog
Provider-agnostic repository contracts and bases for a relational domain event store, and contracts for a transactional task outbox.
This package builds on Infrastructure.Persistence.Db and Core.Events. Applications own their schema and supply
concrete repositories and provider-specific embedded SQL.
dotnet add package Anarchy.Toolkit.Infrastructure.Persistence.Db.Events
How to use it
- Derive domain event writers from
DbEventWriterRepositoryBaseand readers fromDbDomainEventReaderRepositoryBase. - Implement the outbox reader and writer contracts in the application. Save tasks in the same unit-of-work transaction as the business changes, then use a relay to publish the pending tasks.
- Ship the
DomainEvent.Get.*and auxiliary type-table queries described on the event repository bases. Type identifiers are resolved against the caller's database and active transaction on every lookup; no identifier is shared across lookups. The provider's get-or-insert SQL and database unique constraints coordinate concurrent registration. A rollback handler is not required for this resolution path.
SQL contract for custom attributes
IEventEnvelope.CustomAttributes is stored separately from event data as a JSON object with string values. Add a
text/JSON column (for example custom_attributes) to the event table. The column may be nullable:
a SQL NULL is read as an empty attribute dictionary.
- The concrete domain event writer must serialize
CustomAttributesand bind the JSON text in its insert query. - Every event query returning a
DomainEventDbRecordmust select the column as a string aliasedCustomAttributes. Cast a native JSON column to text where the driver requires it. - Outbox implementations define their own schema, serialization, duplicate handling, retention and cleanup policy.
Releases
See the release notes for the complete release history.
| 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
- Anarchy.Toolkit.Core.Events (>= 3.0.0)
- Anarchy.Toolkit.Infrastructure.Persistence.Db (>= 3.0.0)
- Dapper (= 2.1.79)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
- Polly.Core (>= 8.9.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## Releases
### 1.0.0
- Introduce relational event-store repository bases, Outbox contracts and records, a type identifier resolver, and a rollback handler.
- Support round-tripping event custom attributes through consumer-owned SQL as a JSON object.