HerrGeneral.WriteSide
1.6.0
See the version list below for details.
dotnet add package HerrGeneral.WriteSide --version 1.6.0
NuGet\Install-Package HerrGeneral.WriteSide -Version 1.6.0
<PackageReference Include="HerrGeneral.WriteSide" Version="1.6.0" />
<PackageVersion Include="HerrGeneral.WriteSide" Version="1.6.0" />
<PackageReference Include="HerrGeneral.WriteSide" />
paket add HerrGeneral.WriteSide --version 1.6.0
#r "nuget: HerrGeneral.WriteSide, 1.6.0"
#:package HerrGeneral.WriteSide@1.6.0
#addin nuget:?package=HerrGeneral.WriteSide&version=1.6.0
#tool nuget:?package=HerrGeneral.WriteSide&version=1.6.0
HerrGeneral.WriteSide
Overview
(Optional)
Interfaces and attributes for Herr General WriteSide:
ICommandHandlerandIEventHandlerfor strong-typed handler mapping without reflection.[LockKey<TAggregate>]andIKeyedCommandfor command concurrency control and partition-based locking.
Pros: no reflection to resolve handlers, compile-time safety for concurrency keys
Cons: adds a dependency on HerrGeneral in the write model
NuGet Packages
dotnet add package HerrGeneral.WriteSide
Command Concurrency & Locking
HerrGeneral provides partition-based concurrency control to serialize commands targeting the same entity while executing independent commands concurrently.
1. Attribute-Based Locking (Recommended)
Use [LockKey<TAggregate>] on the identifier property of your command. This is the simplest, most concise, and type-safe approach for positional records:
using HerrGeneral.WriteSide;
public record CancelOrder(
[property: LockKey<Order>] Guid OrderId,
string Reason
);
You can also use the non-generic [LockKey(typeof(Order))]:
public record UpdateAddress(
[property: LockKey(typeof(Order))] Guid OrderId,
string Street,
string City
);
Benefits:
- Zero boilerplate: Single attribute directly on the record parameter.
- Automatic key qualification: The lock is scoped to
(typeof(Order), OrderId), preventing lock collisions between different aggregate types with identical IDs.
2. Interface-Based Locking (Advanced / Extension Point)
For complex, dynamic, or composite keys (e.g., multi-tenancy), implement IKeyedCommand:
using HerrGeneral.WriteSide;
public record TransferFunds(
Guid TenantId,
Guid SourceAccountId,
decimal Amount
) : IKeyedCommand
{
// Composite lock key
public object Key => (TenantId, typeof(Account), SourceAccountId);
}
| 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
- HerrGeneral.Primitives (>= 1.6.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on HerrGeneral.WriteSide:
| Package | Downloads |
|---|---|
|
HerrGeneral.Core
Core mediator, pipeline, and concurrency framework for HerrGeneral CQRS library |
|
|
HerrGeneral.WriteSide.DDD
Write-side DDD aggregate repositories and command dispatching for HerrGeneral |
|
|
HerrGeneral.Core.DDD
Domain-Driven Design (DDD) aggregate lifecycle and dynamic handler integration for HerrGeneral |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.7.0 | 121 | 10/7/2026 |
| 1.6.0 | 125 | 10/5/2026 |
| 1.5.1-alpha.0.30 | 79 | 10/5/2026 |
| 1.3.0 | 760 | 12/1/2025 |
| 1.2.1-alpha.0.2 | 436 | 11/30/2025 |
| 1.0.1-alpha.0.3 | 395 | 11/20/2025 |
| 0.1.26-rc | 360 | 11/11/2025 |
| 0.1.25-rc | 272 | 9/25/2025 |
| 0.1.24-rc | 219 | 9/12/2025 |
| 0.1.23-rc | 259 | 9/11/2025 |
| 0.1.22-rc | 256 | 9/11/2025 |
| 0.1.21-rc | 183 | 8/23/2025 |
| 0.1.20-rc | 336 | 8/7/2025 |
| 0.1.19-rc | 338 | 8/6/2025 |
| 0.1.18-rc | 166 | 8/1/2025 |
| 0.1.17-rc | 241 | 7/13/2025 |
| 0.1.16-rc | 196 | 7/4/2025 |
| 0.1.15-rc | 261 | 7/1/2025 |
| 0.1.14-rc | 218 | 6/28/2025 |
| 0.1.13-rc | 257 | 11/12/2024 |