Table of Contents

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

draftId MailDraftId

The draft the file was attached to.

attachmentId MailDraftAttachmentId

The file to take off.

cancellationToken CancellationToken

Cancels the read and the write.

Returns

Task<bool>

true when a file was taken off; false when the draft carries none under that identifier.

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.