IAzureCosmosDbLockEnvironment Method

Locks an EnvironmentDto and its children.

Definition

Namespace: MobileTrack.DataContainers.Cosmos
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
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