Method WriteAsync
- Namespace
- MailFathom.Application.Configuration
- Assembly
- MailFathom.Application.dll
WriteAsync(IReadOnlyList<ConfigurationEdit>, long, CancellationToken)
Applies changes to the deployment's persisted configuration.
Task<ConfigurationWriteResult> WriteAsync(IReadOnlyList<ConfigurationEdit> edits, long expectedVersion, CancellationToken cancellationToken)
Parameters
editsIReadOnlyList<ConfigurationEdit>The changes, applied together or not at all, in the order given.
expectedVersionlongThe version the changes were authored against, which the commit is accepted against.
cancellationTokenCancellationTokenCancels the read and the commit, and a write cancelled before the commit leaves the deployment's configuration unchanged. It does not cancel the judgement between them — composing the candidate, binding it, and running the validators is one bounded step this port completes rather than abandons half-composed — and it does not cancel the republish that follows a durable commit, which is MailFathom's own to finish rather than the caller's to abandon.
Returns
- Task<ConfigurationWriteResult>
The version the write committed, or the reason the deployment's settings are unchanged.
Exceptions
- ArgumentNullException
Thrown when
editsis null.- ArgumentException
Thrown when
editsis empty.- ArgumentOutOfRangeException
Thrown when
expectedVersionis negative, or wheneditscarries more than MaximumEdits changes.