Table of Contents

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

edits IReadOnlyList<ConfigurationEdit>

The changes, applied together or not at all, in the order given.

expectedVersion long

The version the changes were authored against, which the commit is accepted against.

cancellationToken CancellationToken

Cancels 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 edits is null.

ArgumentException

Thrown when edits is empty.

ArgumentOutOfRangeException

Thrown when expectedVersion is negative, or when edits carries more than MaximumEdits changes.