Interface ISettingStore
- Namespace
- Stratara.Abstractions.Settings
- Assembly
- Stratara.Abstractions.dll
Persistence SPI of the settings plane: string values addressed by setting name and exact SettingScope. Row-per-key storage keeps field-wise fallback, partial updates, SQL querying, and one-call erasure sweeps.
public interface ISettingStore
- Extension Methods
Remarks
The store is deliberately catalog-unaware and untyped — the read facade (ISettingProvider) layers definitions, fallback, and typing on top. Write access (admin UIs, user preference endpoints) goes through this store directly.
Methods
DeleteScopeAsync(SettingScope, CancellationToken)
Erasure sweep — the settings-plane sibling of the key store's scope erasure. Unlike the exact-scope reads/writes, the sweep widens per dimension: a user scope deletes the user's values in every tenant (and their user-global values), a tenant scope deletes the tenant's values for every user (and its tenant-global values), the global scope deletes only global values.
Task DeleteScopeAsync(SettingScope scope, CancellationToken cancellationToken = default)
Parameters
scopeSettingScopeThe scope naming the user and/or tenant to erase.
cancellationTokenCancellationTokenToken to observe while deleting.
Returns
GetAllAsync(SettingScope, CancellationToken)
Gets every value stored in exactly this scope, keyed by setting name.
Task<IReadOnlyDictionary<string, string>> GetAllAsync(SettingScope scope, CancellationToken cancellationToken = default)
Parameters
scopeSettingScopeThe exact scope to read.
cancellationTokenCancellationTokenToken to observe while reading.
Returns
- Task<IReadOnlyDictionary<string, string>>
The scope's values; empty when the scope holds none.
GetOrNullAsync(string, SettingScope, CancellationToken)
Gets the value stored for the name in exactly this scope, or null when none is set.
Task<string?> GetOrNullAsync(string name, SettingScope scope, CancellationToken cancellationToken = default)
Parameters
namestringThe setting name.
scopeSettingScopeThe exact scope to read.
cancellationTokenCancellationTokenToken to observe while reading.
Returns
SetAsync(string, string?, SettingScope, CancellationToken)
Sets the value for the name in exactly this scope; null deletes the entry.
Task SetAsync(string name, string? value, SettingScope scope, CancellationToken cancellationToken = default)
Parameters
namestringThe setting name.
valuestringThe value to store, or
nullto remove the scope's value.scopeSettingScopeThe exact scope to write.
cancellationTokenCancellationTokenToken to observe while writing.