Table of Contents

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

id NotificationId

What addresses the notification.

user UserId

The user it happened to.

kind NotificationKind

What part of MailFathom it is about.

title string

The headline the row is drawn with.

body string

The second line the row is drawn with.

statement NotificationStatement

What the notification says as a condition and its numbers, or null where the row names no condition.

source string

What the source line names beyond the kind, or null where the kind is the whole of it.

target NotificationTarget

Where opening it leads.

deduplicationKey NotificationDeduplicationKey

The condition it was raised for.

occurredAt DateTimeOffset

When 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 target is null.

ArgumentException

Thrown when title or body is blank, when source is present and blank, when user names nobody, or when id or deduplicationKey is the struct default.

ArgumentOutOfRangeException

Thrown when kind is not a declared kind, or when a text exceeds the bound stated for it.