A collection of libraries used across my .NET projects.
A lightweight framework implementing the Command Query Separation pattern in .NET, providing a standardized way to handle application logic and maintain state integrity with a unified, result-oriented flow.
See the docs for a detailed guide to the various classes provided.
Result and Result<T> classes for robust result handling and a validation state for standardized error responses.
A base class for testing using NUnit and Moq, providing assertion methods tailored for Result types and an automated teardown mechanism invoking VerifyAllAndNoOtherCalls to ensure mock integrity.
Base classes for testing CQRS handlers defined using DannyGoodacre.Cqrs.
Instead of throwing exceptions, every handler returns a Result or Result<T>, encapsulating the status of the operation, any returned data, any validation errors, and any exceptions.
| Type | Purpose | Key Feature |
|---|---|---|
| Query | Read-only operations | Returns Result<T> with data payload |
| Command | Side-effects only | Best for external integrations |
| StateCommand | Persistence-focused | Standardized SaveChangesAsync flow |
| TransactionCommand | Atomic persistence | Explicit transactions with ExpectedChanges guards |