AzureCosmosDbCreateCompany Method

Creates a company in the database. This method can only be executed by MobileTrack employees.

Definition

Namespace: MobileTrack.DataContainers.Cosmos
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
public Task<CompanyDto> CreateCompany(
	CompanyDto company,
	UserSessionData createdBy,
	CancellationToken cancellationToken = default
)

Parameters

company  CompanyDto
Company to create
createdBy  UserSessionData
User creating the company
cancellationToken  CancellationToken  (Optional)
Cancellation token (optional)

Return Value

TaskCompanyDto
Cosmos DB Object-creation Task

Implements

IAzureCosmosDbCreateCompany(CompanyDto, UserSessionData, CancellationToken)

Exceptions

UnauthorizedAccessExceptionThrown if the user createdBy did not have the correct permissions
ArgumentNullExceptionThrown if company or createdBy was
ResourceInvalidStateExceptionThrown if company is in an invalid state.

See Also