INotification
Namespace: RA.Utilities.Dispatcher.Abstractions
INotification is the marker interface for your notifications — the events of your publish/subscribe system. It carries no members; notifications are plain DTOs describing something that happened.
📦 Type Definition
/// <summary>
/// Represents a notification that can be published and handled by zero or more handlers.
/// </summary>
public interface INotification;
🚀 Usage
public record OrderPlaced(int OrderId, string CustomerEmail) : INotification;
public record UserCreatedEvent(Guid UserId) : INotification;
🎯 Send vs Publish
IRequest<TResponse> | INotification |
|---|---|
| Exactly one handler | Zero or more handlers |
| Caller expects a response | Fire-and-forget side effects |
dispatcher.Send(...) | dispatcher.Publish(...) |
Publishing:
Result publishResult = await dispatcher.Publish(new OrderPlaced(42, "customer@example.com"), ct);
// Publish runs every handler; failures are aggregated into the returned Result.
🔗 Related
INotificationHandler<TNotification>— the subscriber contract.INotificationBehavior<TNotification>— cross-cutting concerns per notification handler.