Skip to main content
Table of Contents

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

name string

The declared setting name.

defaultValue T

The value to return when nothing resolves.

cancellationToken CancellationToken

Token to observe while resolving.

Returns

Task<T>

The converted effective value, or defaultValue.

Type Parameters

T

The 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

name string

The declared setting name.

cancellationToken CancellationToken

Token to observe while resolving.

Returns

Task<string>

The effective value, or null.

Exceptions

InvalidOperationException

The name is not declared in the catalog.