Table of Contents

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

session IPersistenceSession

The explicit persistence session this content write participates in.

storedEmailId StoredEmailId

The stable local identifier of the corresponding metadata row.

occurrenceId EmailOccurrenceId

The 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.

placedContent PlacedEmailContent

What PlaceContentAsync(EmailContentKind, ReadOnlyMemory<byte>, CancellationToken) answered for this payload.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task

A task that completes after durable storage.

Exceptions

InvalidOperationException

Thrown when the row under storedEmailId mirrors a different occurrence.