ISettingsUnitTransactionStrategyExecuteInWriterLockAsync - метод

Executes a modification request for a settings unit within a reader/writer lock and inside a transaction.

Definition

Пространство имён: Tessa.SettingsUnits
Сборка: Tessa (в Tessa.dll) Версия: 4.2.1+2efecbe35c10dec386bb05925f2876c4acbb708d
C#
Task<bool> ExecuteInWriterLockAsync(
	SettingsUnitKey key,
	bool? shouldExist,
	int versionIfExists,
	IValidationResultBuilder validationResult,
	Func<SettingsUnitTransactionParameter, Task> asyncAction,
	CancellationToken cancellationToken = default
)

Параметры

key  SettingsUnitKey
The unique key for identifying a settings unit or fragment for which the lock is being established.
shouldExist  NullableBoolean
Indicates the expected existence of the settings unit in the system.
  • – The unit must exist
  • – The unit must not exist
  • – Existence doesn't matter
versionIfExists  Int32
The version number of the settings unit for which the transaction should be opened.
  • > 0 – Check the version number only if the unit is expected to exist (ShouldExist is not )
  • <= 0 – The version number is ignored; only existence checks may be performed depending on ShouldExist
validationResult  IValidationResultBuilder
Объект, выполняющий построение результата валидации.
asyncAction  FuncSettingsUnitTransactionParameter, Task
The modification request for the settings unit, accepting a parameter with transaction information.
cancellationToken  CancellationToken  (Optional)
Propagates notification that operations should be canceled.

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

TaskBoolean
if the request completed successfully; if an exception occurred during transaction creation or request execution, resulting in a rollback of the initiated transaction.

См. также