Method EraseAsync
- Namespace
- MailFathom.Application.Notifications
- Assembly
- MailFathom.Application.dll
EraseAsync(UserId, IReadOnlyCollection<NotificationId>, CancellationToken)
Erases the named notifications, of those the given user holds.
Task<int> EraseAsync(UserId user, IReadOnlyCollection<NotificationId> notifications, CancellationToken cancellationToken)
Parameters
userUserIdThe user whose notifications are erased, which is what scopes the write.
notificationsIReadOnlyCollection<NotificationId>The notifications to erase, which may name none.
cancellationTokenCancellationTokenCancels the erasure.
Returns
- Task<int>
How many notifications were erased, which is fewer than were named where any of them was already gone.
Remarks
The user is part of the addressing rather than a filter applied after a lookup, exactly as it is for the read state above: an identifier is not a capability, so a notification another user holds is not erased and is not reported either. An identifier naming nothing is the same answer, which is what makes erasing something already gone the act the caller wanted rather than an error — the count is what happened, never what was asked for.
Exceptions
- ArgumentNullException
Thrown when
notificationsis null.