Table of Contents

Method ReadForUserAsync

Namespace
MailFathom.Application.Mail.Delivery.Drafts
Assembly
MailFathom.Application.dll

ReadForUserAsync(UserId, MailAccountId?, int, CancellationToken)

Reads the drafts one user is still writing, newest edit first.

Task<IReadOnlyList<MailDraftRecord>> ReadForUserAsync(UserId user, MailAccountId? account, int maxCount, CancellationToken cancellationToken)

Parameters

user UserId

The user whose drafts are read.

account MailAccountId?

The account to narrow to, or null for every account this user owns.

maxCount int

The greatest number of drafts to answer with.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<MailDraftRecord>>

The drafts, ordered by when each last changed, newest first, bounded by maxCount.

Remarks

It is the user's own listing rather than a pass's, so what it answers with is what a person would recognize as their drafts: one that has been given up is on its way out and one that has been promoted is a queued message, and neither is something to go on editing. Bounded rather than paged, because the set is what one person has open at a time — a user who reaches the bound has more drafts than a screen shows and is told so by the count rather than handed a cursor into their own composition.