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.0+ffad8363f63902f18b3b3f4cfa533a14b2fb19a6
C#
Task<bool> ExecuteInWriterLockAsync(
	Guid id,
	bool? shouldExist,
	int versionIfExists,
	IValidationResultBuilder validationResult,
	Func<SettingsUnitTransactionParameter, Task> asyncAction,
	CancellationToken cancellationToken = default
)

Параметры

id  Guid
The unique identifier of the settings unit for which the lock is 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.

См. также