Claudalisk.Domain
0.1.0-alpha.5
dotnet add package Claudalisk.Domain --version 0.1.0-alpha.5
NuGet\Install-Package Claudalisk.Domain -Version 0.1.0-alpha.5
<PackageReference Include="Claudalisk.Domain" Version="0.1.0-alpha.5" />
<PackageVersion Include="Claudalisk.Domain" Version="0.1.0-alpha.5" />
<PackageReference Include="Claudalisk.Domain" />
paket add Claudalisk.Domain --version 0.1.0-alpha.5
#r "nuget: Claudalisk.Domain, 0.1.0-alpha.5"
#:package Claudalisk.Domain@0.1.0-alpha.5
#addin nuget:?package=Claudalisk.Domain&version=0.1.0-alpha.5&prerelease
#tool nuget:?package=Claudalisk.Domain&version=0.1.0-alpha.5&prerelease
Claudalisk.Domain
Domain building blocks: the aggregate base, domain events, DomainException and DependencyUnavailableException. The package has no dependencies.
Aggregates and versions
An aggregate derives from AggregateRoot. It starts at Version 1 (AggregateRoot.InitialVersion). The constructor that takes a version, for loading a stored aggregate, throws ArgumentOutOfRangeException below 1.
IncrementVersion()adds one. Call it when the aggregate changes.RequireVersion(expectedVersion)throwsStaleVersionExceptionwhen the aggregate is at another version. Use it to check the version a client sent, for example from anIf-Matchheader.
StaleVersionException carries ExpectedVersion and ActualVersion. The web package maps it to 412, and the jobs library fails a job with it without retry.
Domain events
An event is a class that implements the marker interface IDomainEvent. An aggregate records one with the protected Record method. DomainEvents shows the recorded events, and TakeDomainEvents() returns them and clears the list, so a caller publishes each event once.
Domain errors
Derive from DomainException for a rule that a request broke. The constructor takes:
slug: lower-case words joined by hyphens, such asalready-shipped. It becomes the end of the problem type.title: the message, which cannot be blank. The web package sends it as the problem'sdetail.kind:DomainErrorKind.Conflict,NotFoundorForbidden, which the web package maps to 409, 404 and 403.extensions: optional members for the response body.innerException: optional.
public sealed class AlreadyShippedException()
: DomainException("already-shipped", "The order has already shipped.", DomainErrorKind.Conflict);
The constructor throws ArgumentException for a bad slug, and for an extension that is given twice (ignoring case) or would replace a Problem Details member: type, title, status, detail, instance, errors and traceId. Extensions is a read-only copy.
Unavailable dependencies
DependencyUnavailableException says that something the request needs is down. It is not a domain rule. RetryAfter is an optional wait and cannot be negative. The web package answers 503 with a Retry-After header, and the jobs library retries the job, waiting at least RetryAfter.
| 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. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Claudalisk.Domain:
| Package | Downloads |
|---|---|
|
Claudalisk.AspNetCore
What every Host needs: one Problem Details handler, conditional writes, HAL members, the health endpoint and module tags in the OpenAPI document. |
|
|
Claudalisk.Jobs
Queued work as jobs: queueing in the unit of work, workers with retries, heartbeats, cancel and progress, batch jobs, event fan-out and the jobs router. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.5 | 95 | 11/24/2026 |
| 0.1.0-alpha.4 | 167 | 11/22/2026 |
| 0.1.0-alpha.3 | 80 | 11/22/2026 |
| 0.1.0-alpha.2 | 87 | 11/21/2026 |
| 0.1.0-alpha.1 | 685 | 11/8/2026 |