Method FindAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
FindAsync(MailDraftId, CancellationToken)
Reads one draft of the caller's own user, or answers that they hold none under that identifier.
public Task<MailDraftRecord?> FindAsync(MailDraftId draftId, CancellationToken cancellationToken)
Parameters
draftIdMailDraftIdThe draft to read.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<MailDraftRecord>
The draft, or null when this user holds none under that identifier.
Remarks
Every act a user-facing surface takes on a draft passes through this first, which is what keeps an identifier from reaching a book that acts on whatever it is handed. The user is compared against the draft's own recorded user rather than against the accounts listing, so an account withdrawn from the record since the draft was written still resolves to the person who wrote it.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold MailDraftsWrite, or is acting for no user.