IAzureCosmosDbLockEnvironment Method

Locks an EnvironmentDto and its children.

Definition

Namespace: MobileTrack.DataContainers.Cosmos
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
Task LockEnvironment(
	EnvironmentDto environment,
	CompanyDto company,
	UserSessionData lockedBy,
	bool isImplicitLock,
	CancellationToken cancellationToken = default
)

Parameters

environment  EnvironmentDto
Environment to lock
company  CompanyDto
CompanyDto owning the EnvironmentDto
lockedBy  UserSessionData
User locking the EnvironmentDto
isImplicitLock  Boolean
True if environment was locked implicitly
cancellationToken  CancellationToken  (Optional)
Cancellation token

Return Value

Task
Task completion

Exceptions

UnauthorizedAccessExceptionThrown if the user lockedBy did not have the correct permissions
InvalidOperationException Thrown if the environment we're trying to lock is the MainEnvironment of the company
ArgumentNullExceptionThrown if environment, company or lockedBy was

See Also