Table of Contents

Namespace Savvyio.Commands

Assembly: Savvyio.Commands.dll

Use the Savvyio.Commands namespace to model and dispatch write-side operations in a CQRS application. A command represents intent to change state — implement Command as your base class when you want a concrete, serializable command payload, then register a CommandHandler to process it.

Start with Command for your command payload classes. Register a handler that extends CommandHandler<TCommand>, and use SavvyioOptions.AddCommandDispatcher and SavvyioOptions.AddCommandHandler to wire them into the DI container. Route commands through CommandDispatcher or use the higher-level Mediator from Savvyio.Extensions.

Availability: .NET 10 and .NET 9

Extension Members

Type Ext Methods
SavvyioOptions ⬇️ AddCommandHandler<TImplementation>, AddCommandDispatcher

Classes

Command

Provides a default implementation of the ICommand interface.

CommandDispatcher

Provides a default implementation of of the ICommandDispatcher interface.

CommandHandler

Provides a generic and consistent way of handling Command objects that implements the ICommand interface. This is an abstract class.

SavvyioOptionsExtensions

Extension methods for the SavvyioOptions class.

Interfaces

ICommand

A marker interface that specifies an intention to do something (e.g. change the state).

ICommandDispatcher

Defines a Command dispatcher that uses Fire-and-Forget/In-Only MEP.

ICommandHandler

Specifies a handler responsible for objects that implements the ICommand interface.