ModelFactoryGenerateNewAccount Method

Generates a new AccountDto

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+1dadc87dcf0a0f837e19a3ce2deb7c1cd85375d1
public static AccountDto GenerateNewAccount(
	CompanyDto company,
	EnvironmentDto environment,
	AccountDto createdBy,
	IStringLocalizer loc
)

Parameters

company  CompanyDto
Company the Account belongs to
environment  EnvironmentDto
Environment the Account belongs to
createdBy  AccountDto
User creating the account
loc  IStringLocalizer
Localization tool

Return Value

AccountDto
Newly generated Account

Remarks

This method does not check if the user has the correct permissions to create a new account.

Exceptions

InvalidOperationExceptionThrown if environment does not belong to company
UnauthorizedAccessException Thrown if the createdBy is neither a MobileTrack employee nor belongs to the company it's trying to create a new account for.

See Also