Table of Contents

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

user UserId

The user whose notifications are read.

after NotificationCursor?

The boundary a continued walk reads beyond, or null for the newest page.

limit int

The greatest number of notifications the page may hold.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<Notification>>

The page, newest first, holding at most limit notifications.

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 limit is not positive.