Class MongoIconSettingsStore
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
collectionIIconSettingsRepositoryCollection
Methods
LoadAsync(CancellationToken)
The stored settings, or null when nothing has been saved.
public Task<IconSettingsState> LoadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SaveAsync(IconSettingsState, CancellationToken)
public Task SaveAsync(IconSettingsState settings, CancellationToken cancellationToken = default)
Parameters
settingsIconSettingsStatecancellationTokenCancellationToken
Returns
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.