Method UnstageAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
UnstageAsync(MailDraftId, MailDraftAttachmentId, CancellationToken)
Takes one staged file back off a draft the caller's user is writing.
public Task<bool> UnstageAsync(MailDraftId draftId, MailDraftAttachmentId attachmentId, CancellationToken cancellationToken)
Parameters
draftIdMailDraftIdThe draft the file was attached to.
attachmentIdMailDraftAttachmentIdThe file to take off.
cancellationTokenCancellationTokenCancels the read and the write.
Returns
Remarks
Taking a file off twice is one removal, and the second answers that the draft carries no such file rather than failing. The message the draft is stored as still carries the file until the next revision is composed, for the reason staging one does not put it there.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold MailDraftsWrite, or is acting for no user.
- MailDraftRefusedException
Thrown when the caller's user holds no draft still being written under that identifier.
- PersistenceConcurrencyConflictException
Thrown when the write did not commit on any allowed attempt.