Athenex.Whimclean.Domain
2.0.0
Prefix Reserved
dotnet add package Athenex.Whimclean.Domain --version 2.0.0
NuGet\Install-Package Athenex.Whimclean.Domain -Version 2.0.0
<PackageReference Include="Athenex.Whimclean.Domain" Version="2.0.0" />
<PackageVersion Include="Athenex.Whimclean.Domain" Version="2.0.0" />
<PackageReference Include="Athenex.Whimclean.Domain" />
paket add Athenex.Whimclean.Domain --version 2.0.0
#r "nuget: Athenex.Whimclean.Domain, 2.0.0"
#:package Athenex.Whimclean.Domain@2.0.0
#addin nuget:?package=Athenex.Whimclean.Domain&version=2.0.0
#tool nuget:?package=Athenex.Whimclean.Domain&version=2.0.0
Athenex.Whimclean.Domain
Small, dependency-free domain building blocks for .NET 10 applications.
Install
dotnet add package Athenex.Whimclean.Domain
Aggregate roots and domain events
Derive aggregate roots from AggregateRoot<TId> and raise events inside domain behavior:
using Athenex.Whimclean.Domain.Entities;
using Athenex.Whimclean.Domain.Events;
public sealed record OrderSubmitted(Guid OrderId) : DomainEvent;
public sealed class Order : AggregateRoot<Guid>
{
public Order(Guid id) : base(id)
{
}
public void Submit()
{
RaiseDomainEvent(new OrderSubmitted(Id));
}
}
Entity<TId> rejects a default-valued id in its constructor and compares entities by runtime type and Id; two entities whose id is still the default are never equal. DomainEvent is an abstract record that gives every event a version 7 EventId.
Infrastructure reads DomainEvents and calls ClearDomainEvents() after successful dispatch. ClearDomainEvents() is implemented explicitly on IHasDomainEvents, so it is reachable through that interface and stays off the aggregate's public surface.
Operation results
Use Result or Result<TValue> for expected domain and application failures:
using Athenex.Whimclean.Domain.Results;
Result<Guid> CreateOrder(bool valid) => valid
? Result<Guid>.Success(Guid.NewGuid())
: Result<Guid>.Failure(
Error.Validation("Order.Invalid", "The order is invalid."));
Available error factories are Error.Failure, Error.Validation, Error.NotFound, Error.Conflict, Error.Unauthorized and Error.Forbidden; each sets the matching ErrorType. Check IsSuccess or IsFailure before reading Result<TValue>.Value, which throws on a failed result. Values and errors convert implicitly to results, and Match, Map and Bind chain results without unwrapping them.
Behaviors
IActivatable (an IsActive flag, in Athenex.Whimclean.Domain.Behaviors) marks records an operator can switch on and off. Inactive rows stay visible unless a query opts in with WhereActive() from the Application package.
Persistence concerns are not in this package
Audit stamps (CreatedAt, CreatedBy, UpdatedAt, UpdatedBy) and soft deletion (IsDeleted, DeletedAt, DeletedBy) are shadow properties managed by AuditableDbContext in Athenex.Whimclean.Infrastructure.EntityFrameworkCore. An entity type opts into them with HasAuditStamps() and HasSoftDelete() in the EF model configuration, so aggregates declare no persistence fields. An aggregate that needs a value such as CreatedAt for a business rule may declare that property itself; the context then stamps the declared property instead of adding a shadow one.
This package contains no EF Core, ASP.NET Core, Identity, PostgreSQL, or multitenancy dependency.
Text normalization
TextNormalizer in Athenex.Whimclean.Domain.Text is a static helper. NormalizeWhitespace trims and collapses runs of whitespace into single spaces; NormalizeSlug additionally lower-cases the value and turns whitespace, hyphens and underscores into single hyphens, for values that end up in URLs or DNS labels.
Repository and full architecture guide: https://github.com/athene-x/Whimclean
| 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
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Athenex.Whimclean.Domain:
| Package | Downloads |
|---|---|
|
Athenex.Whimclean.Application
Application-layer abstractions for request context, email, pagination, persistence, and validated list queries. |
|
|
Athenex.Whimclean.Infrastructure
Provider-neutral infrastructure building blocks for Whimclean applications, including audit actor resolution and asynchronous domain-event dispatch. |
|
|
Athenex.Whimclean.Auditing
Audit log for Whimclean applications: an audit entry entity, a Mediator pipeline behavior that records every audited command's outcome outside its unit of work, and a change collector fed by domain events. |
|
|
Athenex.Whimclean.Identity.Keycloak
Keycloak integration for Whimclean APIs: JWT bearer authentication with the claim conventions Keycloak tokens use, and an admin API client for provisioning users with a service account. |
|
|
Athenex.Whimflow.Domain
The Whimflow domain model: workflow definitions, published versions, running instances and the engine that walks them. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 258 | 11/17/2026 |
2.0.0: removes IAuditable, ICreateAuditable, IUpdateAuditable, ISoftDelete, AuditableEntity and AuditableAggregateRoot. Audit stamps and soft deletion are now shadow properties maintained by the EF Core package (HasAuditStamps, HasSoftDelete), so the domain model no longer declares persistence fields. See https://github.com/athene-x/Whimclean/blob/main/docs/upgrading-to-2.0.md.