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
userUserIdThe person whose list is read.
originPersonalTaskOrigin?The origin to read, or null for the whole list.
afterPersonalTaskCursor?The position a continued walk reads beyond, or null for the first page.
limitintThe greatest number of tasks the answer may hold.
cancellationTokenCancellationTokenCancels 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
originis not a declared origin, or whenlimitis not positive.- ArgumentException
Thrown when
afteris the struct default, which names no position.