Method SaveResolutionAsync
- Namespace
- MailFathom.Application.Folders
- Assembly
- MailFathom.Application.dll
SaveResolutionAsync(IPersistenceSession, MailAccountId, MailFolderResolution, CancellationToken)
Stages a binding so the generation exists before any occurrence is stored under it.
Task SaveResolutionAsync(IPersistenceSession session, MailAccountId accountId, MailFolderResolution resolution, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe open session whose transaction the staged insert joins.
accountIdMailAccountIdThe account owning the alias.
resolutionMailFolderResolutionThe binding to stage.
cancellationTokenCancellationTokenCancels the lookup before anything is staged.
Returns
- Task
A task that completes once the binding is staged in the caller's session.
Remarks
Staging a binding that is already durable and identical is a no-op rather than a conflict, so a run that resolves the same alias to the same remote folder writes nothing.
Exceptions
- PersistenceConcurrencyConflictException
Thrown when the generation is already held by a binding naming a different remote folder, which means a competing run resolved the same alias elsewhere first. Nothing is staged, because adopting that binding would let one alias generation name two remote folders.