Method ReadAsync
- Namespace
- MailFathom.Infrastructure.Persistence.Settings
- Assembly
- MailFathom.Infrastructure.dll
ReadAsync(PostgresConnectionSettings, SecretValueInterpretation, TimeSpan, CancellationToken)
Reads the deployment's persisted configuration document.
public static Task<RootSettingsDocument> ReadAsync(PostgresConnectionSettings connectionSettings, SecretValueInterpretation interpretation, TimeSpan commandTimeout, CancellationToken cancellationToken)
Parameters
connectionSettingsPostgresConnectionSettingsWhere the connection string and its credential come from, read from the sources beneath this layer.
interpretationSecretValueInterpretationHow the deployment's configured secret-bearing values are interpreted.
commandTimeoutTimeSpanHow long the single read may run before the driver cancels it.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<RootSettingsDocument>
The document and the version it was read at.
Exceptions
- ArgumentNullException
Thrown when
connectionSettingsis null.- ArgumentOutOfRangeException
Thrown when
interpretationis not a supported mode, orcommandTimeoutis not positive.- InvalidOperationException
Thrown when the configured connection settings do not describe a database that can be opened.
- RootSettingsUnreadableException
Thrown when the persisted configuration cannot be read at all.