Method ReadComposedAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
ReadComposedAsync(MailDraftId, CancellationToken)
Reads one of the caller's own drafts back as the words its author wrote, so editing can go on.
public Task<MailDraftReading?> ReadComposedAsync(MailDraftId draftId, CancellationToken cancellationToken)
Parameters
draftIdMailDraftIdThe draft to open.
cancellationTokenCancellationTokenCancels the reads.
Returns
- Task<MailDraftReading>
The draft and what its stored message says, or null when this user holds no such draft.
Remarks
The one reading here that loads a message, and it is asked for one draft by identity because that is what opening a draft is. The listing beside it loads none, which is why the subject and the recipients live on the row: a screen showing what somebody is writing costs one query, and the bytes are read when they open one.
The words come out of the stored message rather than out of a second copy of them, so what an author sees is exactly what would be sent. A draft whose message is missing answers as one this user does not hold: the record and its message are written in one transaction, so a record without one describes a draft nothing could send.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold MailDraftsWrite, or is acting for no user.