ISettingsUnitProviderGetOrThrowAsyncT - метод
Retrieves a strongly-typed object derived from the settings unit record identified by the specified key.
Пространство имён: Tessa.SettingsUnitsСборка: Tessa (в Tessa.dll) Версия: 4.2.3+85077ef6104b2e81389e52f8b825d77905da3c54
ValueTask<T> GetOrThrowAsync<T>(
SettingsUnitKey key,
Func<SettingsUnitRecord, T> factory,
CancellationToken cancellationToken = default
)
Function GetOrThrowAsync(Of T) (
key As SettingsUnitKey,
factory As Func(Of SettingsUnitRecord, T),
Optional cancellationToken As CancellationToken = Nothing
) As ValueTask(Of T)
generic<typename T>
ValueTask<T> GetOrThrowAsync(
SettingsUnitKey^ key,
Func<SettingsUnitRecord^, T>^ factory,
CancellationToken cancellationToken = CancellationToken()
)
abstract GetOrThrowAsync :
key : SettingsUnitKey *
factory : Func<SettingsUnitRecord, 'T> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> ValueTask<'T>
override GetOrThrowAsync :
key : SettingsUnitKey *
factory : Func<SettingsUnitRecord, 'T> *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> ValueTask<'T>
- key SettingsUnitKey
Key for identifying a settings unit or fragment.
- factory FuncSettingsUnitRecord, T
-
A delegate that receives the SettingsUnitRecord and produces an instance of type T.
Important: The factory delegate should be fast and avoid blocking operations, as it may be called inside a lock.
- cancellationToken CancellationToken (Optional)
Propagates notification that operations should be canceled.
- T
- The type of object to construct from the settings unit record.
ValueTaskTThe requested object of type
T, guaranteed to be non-
.
When the
InitializationState is not
Initialized,
the record passed to the
factory is created with default values rather than loaded from the system.
Use the
Initialized property to indicate such records.
Such record is not cached at provider instance.
| ValidationException |
Thrown when the settings unit record could not be loaded or any validation error occurred during the operation.
|