ModelFactoryGenerateNewAccount Method

Generates a new AccountDto

Definition

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