Method For
- Namespace
- MailFathom.Domain.Notifications
- Assembly
- MailFathom.Domain.dll
For(string, string)
Composes a key from the name of a condition and the thing it is about.
public static NotificationDeduplicationKey For(string condition, string subject)
Parameters
conditionstringMailFathom's own fixed word for what happened.
subjectstringWhat the condition is about, which is an account identifier today.
Returns
- NotificationDeduplicationKey
A validated deduplication key naming that condition about that subject.
Remarks
The subject is the unbounded half: an account identifier is the operator's own text and nothing validates its length, so a long enough one would push the composed key past MaximumLength and refuse every notification that account ever produced. Where the pair does not fit, the subject is replaced by a digest of itself rather than truncated, because two accounts sharing a long prefix would otherwise share one condition and silence each other's statements. The ordinary key stays the readable one; only an unreasonable identifier reaches the digest.
Exceptions
- ArgumentException
Thrown when either part is blank.
- ArgumentOutOfRangeException
Thrown when
conditionalone cannot fit within MaximumLength beside a reduced subject.