Method ReadAsync
- Namespace
- MailFathom.Application.Folders.Local
- Assembly
- MailFathom.Application.dll
ReadAsync(IPersistenceSession, MailAccountId, CancellationToken)
Reads the account's phase and folders inside the transaction a write will commit.
Task<LocalMailFolderHolding?> ReadAsync(IPersistenceSession session, MailAccountId account, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe transaction the edit commits in.
accountMailAccountIdThe account.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<LocalMailFolderHolding>
The holding, or null where the deployment holds no such account.
Remarks
A later SaveAsync(IPersistenceSession, MailAccountId, IReadOnlyCollection<LocalMailFolder>, IReadOnlyCollection<LocalMailFolderId>, CancellationToken) in the same session is conditional on the hierarchy not having changed since this read, so two edits reaching one account at once conflict and the loser decides again from what the winner wrote rather than both committing against the same picture.
ReadAsync(MailAccountId, CancellationToken)
Reads the account's phase and folders, joining no transaction.
Task<LocalMailFolderHolding?> ReadAsync(MailAccountId account, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<LocalMailFolderHolding>
The holding, or null where the deployment holds no such account.