ModelFactoryGenerateNewAccount Method

Generates a new AccountDto

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.7+ce90b2cf6b782b8d7b7fd47b3c546987c652c00f
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