Method SaveContentAsync
- Namespace
- MailFathom.Application.EmailContent.Storage
- Assembly
- MailFathom.Application.dll
SaveContentAsync(IPersistenceSession, StoredEmailId, EmailOccurrenceId?, PlacedEmailContent, CancellationToken)
Saves raw MIME content idempotently for one locally stored email.
Task SaveContentAsync(IPersistenceSession session, StoredEmailId storedEmailId, EmailOccurrenceId? occurrenceId, PlacedEmailContent placedContent, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this content write participates in.
storedEmailIdStoredEmailIdThe stable local identifier of the corresponding metadata row.
occurrenceIdEmailOccurrenceIdThe remote occurrence the payload was fetched from, which the row is checked against, or null for a message MailFathom filed itself, whose row has to carry no occurrence.
placedContentPlacedEmailContentWhat PlaceContentAsync(EmailContentKind, ReadOnlyMemory<byte>, CancellationToken) answered for this payload.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task
A task that completes after durable storage.
Exceptions
- InvalidOperationException
Thrown when the row under
storedEmailIdmirrors a different occurrence.