Interface ISettingProvider
- Namespace
- Stratara.Abstractions.Settings
- Assembly
- Stratara.Abstractions.dll
Read facade of the settings plane: resolves a setting for the current session by
walking the scope fallback chain — user-in-tenant → user → tenant → global — then the host
configuration (Stratara:Settings:<name>), then the definition's code default.
Scopes are fed from the session's Subject (data-owner) ids, never the actor.
public interface ISettingProvider
- Extension Methods
Remarks
Definitions declared with IsInherited = false consult only the most specific scope
applicable to the session before falling through to configuration/default. Reading an
undeclared name throws — the catalog is the vocabulary. Writes go through
ISettingStore directly.
Methods
GetAsync<T>(string, T, CancellationToken)
Resolves the setting's effective value converted to T, falling
back to defaultValue when unresolved.
Task<T> GetAsync<T>(string name, T defaultValue = default, CancellationToken cancellationToken = default)
Parameters
namestringThe declared setting name.
defaultValueTThe value to return when nothing resolves.
cancellationTokenCancellationTokenToken to observe while resolving.
Returns
- Task<T>
The converted effective value, or
defaultValue.
Type Parameters
TThe target type (convertible from the stored string).
Exceptions
- InvalidOperationException
The name is not declared in the catalog.
GetOrNullAsync(string, CancellationToken)
Resolves the setting's effective string value for the current session, or null
when no scope, configuration entry, or default carries one.
Task<string?> GetOrNullAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringThe declared setting name.
cancellationTokenCancellationTokenToken to observe while resolving.
Returns
Exceptions
- InvalidOperationException
The name is not declared in the catalog.