Claudalisk.Domain 0.1.0-alpha.5

This is a prerelease version of Claudalisk.Domain.
dotnet add package Claudalisk.Domain --version 0.1.0-alpha.5
                    
NuGet\Install-Package Claudalisk.Domain -Version 0.1.0-alpha.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="Claudalisk.Domain" Version="0.1.0-alpha.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Claudalisk.Domain" Version="0.1.0-alpha.5" />
                    
Directory.Packages.props
<PackageReference Include="Claudalisk.Domain" />
                    
Project file
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 Claudalisk.Domain --version 0.1.0-alpha.5
                    
#r "nuget: Claudalisk.Domain, 0.1.0-alpha.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 Claudalisk.Domain@0.1.0-alpha.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=Claudalisk.Domain&version=0.1.0-alpha.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Claudalisk.Domain&version=0.1.0-alpha.5&prerelease
                    
Install as a Cake Tool

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) throws StaleVersionException when the aggregate is at another version. Use it to check the version a client sent, for example from an If-Match header.

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 as already-shipped. It becomes the end of the problem type.
  • title: the message, which cannot be blank. The web package sends it as the problem's detail.
  • kind: DomainErrorKind.Conflict, NotFound or Forbidden, 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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