HerrGeneral.WriteSide
1.7.1
See the version list below for details.
dotnet add package HerrGeneral.WriteSide --version 1.7.1
NuGet\Install-Package HerrGeneral.WriteSide -Version 1.7.1
<PackageReference Include="HerrGeneral.WriteSide" Version="1.7.1" />
<PackageVersion Include="HerrGeneral.WriteSide" Version="1.7.1" />
<PackageReference Include="HerrGeneral.WriteSide" />
paket add HerrGeneral.WriteSide --version 1.7.1
#r "nuget: HerrGeneral.WriteSide, 1.7.1"
#:package HerrGeneral.WriteSide@1.7.1
#addin nuget:?package=HerrGeneral.WriteSide&version=1.7.1
#tool nuget:?package=HerrGeneral.WriteSide&version=1.7.1
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.7.1)
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.8.0 | 101 | 11/18/2026 |
| 1.7.1 | 80 | 11/18/2026 |
| 1.7.0 | 171 | 10/7/2026 |
| 1.6.0 | 144 | 10/5/2026 |
| 1.5.1-alpha.0.30 | 93 | 10/5/2026 |
| 1.3.0 | 772 | 12/1/2025 |
| 1.2.1-alpha.0.2 | 441 | 11/30/2025 |
| 1.0.1-alpha.0.3 | 403 | 11/20/2025 |
| 0.1.26-rc | 366 | 11/11/2025 |
| 0.1.25-rc | 279 | 9/25/2025 |
| 0.1.24-rc | 226 | 9/12/2025 |
| 0.1.23-rc | 264 | 9/11/2025 |
| 0.1.22-rc | 261 | 9/11/2025 |
| 0.1.21-rc | 192 | 8/23/2025 |
| 0.1.20-rc | 341 | 8/7/2025 |
| 0.1.19-rc | 346 | 8/6/2025 |
| 0.1.18-rc | 172 | 8/1/2025 |
| 0.1.17-rc | 249 | 7/13/2025 |
| 0.1.16-rc | 204 | 7/4/2025 |
| 0.1.15-rc | 266 | 7/1/2025 |