Skip to main content

Behaviors

Namespace: RA.Utilities.Dispatcher.Behaviors

RA.Utilities.Dispatcher.Behaviors provides built-in IPipelineBehavior and INotificationBehavior implementations for common cross-cutting concerns.

📦 Request Pipeline Behaviors​

BehaviorInterfacePurpose
LoggingBehavior<TRequest>IPipelineBehavior<TRequest>Logs each request and its result
LoggingBehavior<TRequest, TResponse>IPipelineBehavior<TRequest, TResponse>Logs each request and its response
ValidationBehavior<TRequest>IPipelineBehavior<TRequest>Validates requests via FluentValidation; returns a failed Result containing a BadRequestException on invalid requests
ValidationBehavior<TRequest, TResponse>IPipelineBehavior<TRequest, TResponse>Validates requests via FluentValidation; returns a failed Result containing a BadRequestException on invalid requests

📬 Notification Pipeline Behaviors​

BehaviorInterfacePurpose
NotificationLoggingBehavior<TNotification>INotificationBehavior<TNotification>Logs notification handling start and finish
NotificationMetricsBehavior<TNotification>INotificationBehavior<TNotification>Measures handler duration; warns if over 500 ms
NotificationRetryBehavior<TNotification>INotificationBehavior<TNotification>Retries failed handlers with configurable backoff