Interface IUserSettingsDocumentWriter
- Namespace
- MailFathom.Infrastructure.Persistence.Users
- Assembly
- MailFathom.Infrastructure.dll
Commits one user's record over the version it was authored against.
public interface IUserSettingsDocumentWriter
Remarks
The writing half of IUserSettingsDocumentReader, and like it a key lookup rather than a query: one write is one user's row, so there is no shape here that touches two people's records. It holds nothing about what a record may contain — whether the document binds, whether an account collides with another of the same user's, and whether a value is secret material are decisions its caller takes. What this decides is what only the database can: whether the record it is replacing is still the record the caller read, and which settings policies govern the record at the moment it is replaced.
Methods
- CommitAsync(UserId, long, Func<GoverningSettingsPolicies, UserRecordCandidate?>, CancellationToken)
Replaces one user's record, if it still stands at the expected version and the policies in force admit what the caller composes under them.