Table of Contents

Method ReadAsync

Namespace
MailFathom.Application.Tasks
Assembly
MailFathom.Application.dll

ReadAsync(UserId, PersonalTaskOrigin?, PersonalTaskCursor?, int, CancellationToken)

Reads one bounded page of a person's tasks, soonest due first.

Task<IReadOnlyList<PersonalTask>> ReadAsync(UserId user, PersonalTaskOrigin? origin, PersonalTaskCursor? after, int limit, CancellationToken cancellationToken)

Parameters

user UserId

The person whose list is read.

origin PersonalTaskOrigin?

The origin to read, or null for the whole list.

after PersonalTaskCursor?

The position a continued walk reads beyond, or null for the first page.

limit int

The greatest number of tasks the answer may hold.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<PersonalTask>>

The tasks, soonest due first, with the undated ones last, holding at most limit.

Remarks

Naming an origin is what reads the proposals apart from the commitments, so a screen can offer what mail suggested without it standing on the list as something the person agreed to. Completed tasks are read with the outstanding ones, because whether a list shows what is done is the screen's decision and not the store's. The boundary is a position rather than an offset, so a task dated, completed, or accepted 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 origin is not a declared origin, or when limit is not positive.

ArgumentException

Thrown when after is the struct default, which names no position.