Skip to content

dannygoodacre/DannyGoodacre.Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DannyGoodacre.Core

A collection of libraries used across my .NET projects.

DannyGoodacre.Cqrs

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.

DannyGoodacre.Primitives

Result and Result<T> classes for robust result handling and a validation state for standardized error responses.

DannyGoodacre.Testing

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.

DannyGoodacre.Cqrs.Testing

Base classes for testing CQRS handlers defined using DannyGoodacre.Cqrs.

TL;DR

The Result Pattern

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.

The Handlers

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

About

Common libraries used across my .NET projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages