IAzureCosmosDbCreateAccount Method

Creates an account in the database

Definition

Namespace: MobileTrack.DataContainers.Cosmos
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
Task<AccountDto> CreateAccount(
	AccountDto account,
	CompanyDto accountOwner,
	UserSessionData createdBy,
	CancellationToken cancellationToken = default
)

Parameters

account  AccountDto
Account to create
accountOwner  CompanyDto
Owner of the newly created account
createdBy  UserSessionData
User creating the environment
cancellationToken  CancellationToken  (Optional)
Cancellation token (optional)

Return Value

TaskAccountDto
Cosmos DB Object-creation Task

Exceptions

UnauthorizedAccessExceptionThrown if the user createdBy did not have the correct permissions
CosmosExceptionThrown if the Azure Cosmos DB returns a non-OK result
ArgumentNullExceptionThrown if account, accountOwner or createdBy are
ResourceInvalidStateExceptionThrown if account is in an invalid state.

See Also