Interface IHandlerRegistrar
Registers event or command handlers that listen and respond to events or commands.
Namespace: Cqrs.Bus
Assembly: Cqrs.dll
Syntax
[ServiceContract(Namespace = "https://getcqrs.net/Bus/HandlerRegistrar")]
public interface IHandlerRegistrar
Methods
RegisterHandler<TMessage>(Action<TMessage>, Boolean)
Register an event or command handler that will listen and respond to events or commands.
Declaration
[OperationContract]
void RegisterHandler<TMessage>(Action<TMessage> handler, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
System.Action<TMessage> | handler | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
RegisterHandler<TMessage>(Action<TMessage>, Type, Boolean)
Register an event or command handler that will listen and respond to events or commands.
Declaration
[OperationContract]
void RegisterHandler<TMessage>(Action<TMessage> handler, Type targetedType, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
System.Action<TMessage> | handler | |
System.Type | targetedType | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
Remarks
In many cases the targetedType
will be the handler class itself, what you actually want is the target of what is being updated.