Method RecordSettingsAsync
- Namespace
- MailFathom.Infrastructure.Persistence.Users
- Assembly
- MailFathom.Infrastructure.dll
RecordSettingsAsync(Guid, long, Func<GoverningSettingsPolicies, MailAccountQueryableSettings?>, CancellationToken)
Records the settings an account is served on, where the account still stands at the version they were read from.
Task<bool> RecordSettingsAsync(Guid accountId, long readFrom, Func<GoverningSettingsPolicies, MailAccountQueryableSettings?> derive, CancellationToken cancellationToken)
Parameters
accountIdGuidThe account.
readFromlongThe version of the document the settings came from.
deriveFunc<GoverningSettingsPolicies, MailAccountQueryableSettings>Derives the settings under the policies that govern the account, or answers null to record nothing. It is called inside the write's transaction and performs no I/O of its own.
cancellationTokenCancellationTokenCancels the write.
Returns
Remarks
Every write of this build records them with the document; this is for a row a build older than the settings columns wrote alone. The settings are derived under the lock a policy write excludes record writes with, so a policy that lands while a row is being read again is either the one the row is derived from or the one that rewrites it afterwards.
Exceptions
- ArgumentNullException
Thrown when
deriveis null.