Table of Contents

Class MongoIconSettingsStore

Namespace
Tharga.Team.MongoDB
Assembly
Tharga.Team.MongoDB.dll

Built-in IIconSettingsStore backed by MongoDB — the zero-configuration default, registered by AddThargaTeamRepository via TryAdd so a consumer-supplied store takes precedence.

public class MongoIconSettingsStore : IIconSettingsStore
Inheritance
MongoIconSettingsStore
Implements
Inherited Members

Constructors

MongoIconSettingsStore(IIconSettingsRepositoryCollection)

public MongoIconSettingsStore(IIconSettingsRepositoryCollection collection)

Parameters

collection IIconSettingsRepositoryCollection

Methods

LoadAsync(CancellationToken)

The stored settings, or null when nothing has been saved.

public Task<IconSettingsState> LoadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<IconSettingsState>

SaveAsync(IconSettingsState, CancellationToken)

public Task SaveAsync(IconSettingsState settings, CancellationToken cancellationToken = default)

Parameters

settings IconSettingsState
cancellationToken CancellationToken

Returns

Task

Remarks

The document id is fixed rather than generated, so this is a true upsert: the first save creates it and every later one replaces the same document, with no read first and no race between two saves creating two "only" documents. The unique index on Key is the second half of that guarantee, enforced by the store rather than by whoever writes to it.