ISettingsUnitProviderGetAsyncT - метод

Retrieves a strongly-typed object derived from the settings unit record identified by the specified key.

Definition

Пространство имён: Tessa.SettingsUnits
Сборка: Tessa (в Tessa.dll) Версия: 4.2.2+a8f0dd3c063817b2e3f05a923303d808e447c338
C#
ValueTask<T> GetAsync<T>(
	SettingsUnitKey key,
	Func<SettingsUnitRecord, T> factory,
	IValidationResultBuilder validationResult,
	CancellationToken cancellationToken = default
)

Параметры

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.
validationResult  IValidationResultBuilder
Объект, выполняющий построение результата валидации.
cancellationToken  CancellationToken  (Optional)
Propagates notification that operations should be canceled.

Параметры типа

T
The type of object to construct from the settings unit record.

Возвращаемое значение

ValueTaskT
Requested object of type T, or if the settings unit record could not be loaded or validation failed.

Заметки

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.

См. также