Method ReadPageAsync
- Namespace
- MailFathom.Application.Notifications
- Assembly
- MailFathom.Application.dll
ReadPageAsync(UserId, NotificationCursor?, int, CancellationToken)
Reads one bounded page of a user's notifications, newest first.
Task<IReadOnlyList<Notification>> ReadPageAsync(UserId user, NotificationCursor? after, int limit, CancellationToken cancellationToken)
Parameters
userUserIdThe user whose notifications are read.
afterNotificationCursor?The boundary a continued walk reads beyond, or null for the newest page.
limitintThe greatest number of notifications the page may hold.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<Notification>>
The page, newest first, holding at most
limitnotifications.
Remarks
The boundary is a position rather than an offset, so a notification raised while somebody is paging neither shifts the window nor causes a row to be repeated or skipped. Whether the cursor was issued to this user is the caller's question rather than the store's: this reads the user it is given and nothing else.
Exceptions
- ArgumentOutOfRangeException
Thrown when
limitis not positive.