ISettingsUnitLockingStrategyObtainWriterLockAsync - метод
Acquires a write lock for the settings unit. Returns a value indicating whether the lock was successfully acquired.
Пространство имён: Tessa.SettingsUnitsСборка: Tessa (в Tessa.dll) Версия: 4.2.0+ffad8363f63902f18b3b3f4cfa533a14b2fb19a6
Task<bool> ObtainWriterLockAsync(
Guid id,
bool? shouldExist,
int versionIfExists,
IValidationResultBuilder validationResult,
CancellationToken cancellationToken = default
)
Function ObtainWriterLockAsync (
id As Guid,
shouldExist As Boolean?,
versionIfExists As Integer,
validationResult As IValidationResultBuilder,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of Boolean)
Task<bool>^ ObtainWriterLockAsync(
Guid id,
Nullable<bool> shouldExist,
int versionIfExists,
IValidationResultBuilder^ validationResult,
CancellationToken cancellationToken = CancellationToken()
)
abstract ObtainWriterLockAsync :
id : Guid *
shouldExist : Nullable<bool> *
versionIfExists : int *
validationResult : IValidationResultBuilder *
?cancellationToken : CancellationToken
(* Defaults:
let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<bool>
- id Guid
- The unique identifier of the settings unit 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
-
An object responsible for building the validation result, indicating the reason why the lock could not be acquired.
- cancellationToken CancellationToken (Optional)
Propagates notification that operations should be canceled.
TaskBoolean if the lock was successfully acquired;
if an error occurred while acquiring the lock.