Method SaveAsync
- Namespace
- MailFathom.Infrastructure.Persistence.Users
- Assembly
- MailFathom.Infrastructure.dll
SaveAsync(Guid, long, Func<GoverningSettingsPolicies, MailAccountCandidate?>, CancellationToken)
Replaces an account's address, name, and settings where it still stands at the version they were composed over.
Task<MailAccountWrite> SaveAsync(Guid accountId, long expectedVersion, Func<GoverningSettingsPolicies, MailAccountCandidate?> compose, CancellationToken cancellationToken)
Parameters
accountIdGuidThe account.
expectedVersionlongThe version of the account the change was composed over.
composeFunc<GoverningSettingsPolicies, MailAccountCandidate>Composes the account as it is to stand under the policies that govern it, or answers null to write nothing. It is called inside the write's transaction, once per attempt, and performs no I/O of its own.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<MailAccountWrite>
What the write did.
Remarks
The policies are read as CreateAsync(UserId, long, Func<GoverningSettingsPolicies, MailAccountCandidate?>, CancellationToken) reads them, for the account's own organization.
Exceptions
- ArgumentNullException
Thrown when
composeis null.