Method Compose
- Namespace
- MailFathom.Domain.Notifications
- Assembly
- MailFathom.Domain.dll
Compose(NotificationId, UserId, NotificationKind, string, string, NotificationStatement?, string?, NotificationTarget, NotificationDeduplicationKey, DateTimeOffset)
Composes a notification that has not been read.
public static Notification Compose(NotificationId id, UserId user, NotificationKind kind, string title, string body, NotificationStatement? statement, string? source, NotificationTarget target, NotificationDeduplicationKey deduplicationKey, DateTimeOffset occurredAt)
Parameters
idNotificationIdWhat addresses the notification.
userUserIdThe user it happened to.
kindNotificationKindWhat part of MailFathom it is about.
titlestringThe headline the row is drawn with.
bodystringThe second line the row is drawn with.
statementNotificationStatementWhat the notification says as a condition and its numbers, or null where the row names no condition.
sourcestringWhat the source line names beyond the kind, or null where the kind is the whole of it.
targetNotificationTargetWhere opening it leads.
deduplicationKeyNotificationDeduplicationKeyThe condition it was raised for.
occurredAtDateTimeOffsetWhen the thing it describes happened.
Returns
- Notification
An unread notification.
Remarks
The user has to be a named one, because a row written under the unspecified identity would belong to nobody: unreachable by any read and uncollected by any erasure.
Exceptions
- ArgumentNullException
Thrown when
targetis null.- ArgumentException
Thrown when
titleorbodyis blank, whensourceis present and blank, whenusernames nobody, or whenidordeduplicationKeyis the struct default.- ArgumentOutOfRangeException
Thrown when
kindis not a declared kind, or when a text exceeds the bound stated for it.