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
userUserIdThe user whose notifications are aged.
occurredBeforeDateTimeOffsetThe instant a notification must describe something older than to be erased.
limitintThe greatest number of notifications one call may erase.
cancellationTokenCancellationTokenCancels the erasure.
Returns
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
limitis not positive.