Skip to main content
Table of Contents

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

scope SettingScope

The scope naming the user and/or tenant to erase.

cancellationToken CancellationToken

Token to observe while deleting.

Returns

Task

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

scope SettingScope

The exact scope to read.

cancellationToken CancellationToken

Token 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

name string

The setting name.

scope SettingScope

The exact scope to read.

cancellationToken CancellationToken

Token to observe while reading.

Returns

Task<string>

The stored value, or null.

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

name string

The setting name.

value string

The value to store, or null to remove the scope's value.

scope SettingScope

The exact scope to write.

cancellationToken CancellationToken

Token to observe while writing.

Returns

Task