Class MessagingBehaviorBase<TMessage>
Base implementation of a messaging behavior.
Inheritance
Inherited Members
Namespace: Kephas.Messaging.Behaviors
Assembly: Kephas.Messaging.dll
Syntax
public abstract class MessagingBehaviorBase<TMessage> : Loggable, ILoggable, IMessagingBehavior<TMessage>, IMessagingBehavior where TMessage : IMessageType Parameters
| Name | Description | 
|---|---|
| TMessage | The message type. | 
Methods
| Improve this Doc View SourceAfterProcessAsync(TMessage, IMessagingContext, CancellationToken)
Interception called after invoking the handler to process the message.
Declaration
public virtual Task AfterProcessAsync(TMessage message, IMessagingContext context, CancellationToken token)Parameters
| Type | Name | Description | 
|---|---|---|
| TMessage | message | The message. | 
| IMessagingContext | context | The processing context. | 
| System.Threading.CancellationToken | token | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | A task. | 
Remarks
The context will contain the response returned by the handler. The interceptor may change the response or even replace it with another one.
BeforeProcessAsync(TMessage, IMessagingContext, CancellationToken)
Interception called before invoking the handler to process the message.
Declaration
public virtual Task BeforeProcessAsync(TMessage message, IMessagingContext context, CancellationToken token)Parameters
| Type | Name | Description | 
|---|---|---|
| TMessage | message | The message. | 
| IMessagingContext | context | The processing context. | 
| System.Threading.CancellationToken | token | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | A task. | 
Explicit Interface Implementations
| Improve this Doc View SourceIMessagingBehavior.AfterProcessAsync(IMessagingContext, CancellationToken)
Interception called after invoking the handler to process the message.
Declaration
Task IMessagingBehavior.AfterProcessAsync(IMessagingContext context, CancellationToken token)Parameters
| Type | Name | Description | 
|---|---|---|
| IMessagingContext | context | The processing context. | 
| System.Threading.CancellationToken | token | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | A task. | 
Remarks
The context will contain the response returned by the handler. The interceptor may change the response or even replace it with another one.
IMessagingBehavior.BeforeProcessAsync(IMessagingContext, CancellationToken)
Interception called before invoking the handler to process the message.
Declaration
Task IMessagingBehavior.BeforeProcessAsync(IMessagingContext context, CancellationToken token)Parameters
| Type | Name | Description | 
|---|---|---|
| IMessagingContext | context | The processing context. | 
| System.Threading.CancellationToken | token | The cancellation token. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | A task. |