Method StageAttachmentAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
StageAttachmentAsync(IPersistenceSession, MailDraftId, AuthoredEmailAttachment, DateTimeOffset, CancellationToken)
Stages one file against a draft, so every later revision is composed with it.
Task<MailDraftAttachment> StageAttachmentAsync(IPersistenceSession session, MailDraftId draftId, AuthoredEmailAttachment file, DateTimeOffset stagedAt, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
draftIdMailDraftIdThe draft the file is attached to.
fileAuthoredEmailAttachmentWhat the file is called, what it declares itself to be, and the octets it is made of.
stagedAtDateTimeOffsetWhen the upload was taken in.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<MailDraftAttachment>
The staged file as the write left it.
Exceptions
- ArgumentNullException
Thrown when
sessionorfileis null.- InvalidOperationException
Thrown when no draft is held under
draftId.