Class Command<TCtx>.Builder
- Namespace
- PatternKit.Behavioral.Command
- Assembly
- PatternKit.Core.dll
Fluent builder for Command<TCtx>. Not thread-safe; configure on one thread then call Build() once.
public sealed class Command<TCtx>.Builder
- Inheritance
-
Command<TCtx>.Builder
- Inherited Members
Methods
Build()
Build an immutable command instance. Throws if no Do handler was supplied.
public Command<TCtx> Build()
Returns
- Command<TCtx>
Do(Exec)
Set the required asynchronous (or synchronous) Do handler.
public Command<TCtx>.Builder Do(Command<TCtx>.Exec @do)
Parameters
Returns
Do(Action<TCtx>)
Set a synchronous Do handler (adapter wrapped in a ValueTask).
public Command<TCtx>.Builder Do(Action<TCtx> @do)
Parameters
doAction<TCtx>
Returns
Undo(Exec)
Set the optional asynchronous Undo handler.
public Command<TCtx>.Builder Undo(Command<TCtx>.Exec undo)
Parameters
Returns
Undo(Action<TCtx>)
Set a synchronous Undo handler (adapter).
public Command<TCtx>.Builder Undo(Action<TCtx> undo)
Parameters
undoAction<TCtx>