Method SaveAsync
- Namespace
- MailFathom.Application.Emails.ThreadStates
- Assembly
- MailFathom.Application.dll
SaveAsync(IPersistenceSession, EmailThreadState, CancellationToken)
Stages what one derivation settled about one conversation, inside the caller's session.
Task SaveAsync(IPersistenceSession session, EmailThreadState state, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe transaction the write joins.
stateEmailThreadStateWhat was derived, which may hold no statements at all.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the record is staged.
Remarks
Idempotent from a fresh read: the record is keyed by the conversation, so two runs reaching one conversation converge on one row rather than on a history nobody asked for, and the statements a second write brings replace the first's rather than standing beside them.
Exceptions
- ArgumentNullException
Thrown when
stateis null.