Table of Contents

Method EraseOccurredBeforeAsync

Namespace
MailFathom.Application.Notifications
Assembly
MailFathom.Application.dll

EraseOccurredBeforeAsync(UserId, DateTimeOffset, int, CancellationToken)

Erases up to a bounded number of one user's notifications that describe something older than a given instant.

Task<int> EraseOccurredBeforeAsync(UserId user, DateTimeOffset occurredBefore, int limit, CancellationToken cancellationToken)

Parameters

user UserId

The user whose notifications are aged.

occurredBefore DateTimeOffset

The instant a notification must describe something older than to be erased.

limit int

The greatest number of notifications one call may erase.

cancellationToken CancellationToken

Cancels the erasure.

Returns

Task<int>

How many notifications were erased, which reaching limit means more remain.

Remarks

It erases read and unread alike: the bound is a storage-limitation decision about a derived record, not a reading list, and a statement nobody opened in three months is not one they are about to.

Exceptions

ArgumentOutOfRangeException

Thrown when limit is not positive.