private async Task <Result <AccountEntity> > AddAccountAsync(AccountModel account) { if (await _accountStorage.GetByEmailAsync(account.Email) != null) { return(new Result <AccountEntity>(ResultCode.EmailAlreadyExist)); } if (await _accountStorage.GetByLoginAsync(account.Login) != null) { return(new Result <AccountEntity>(ResultCode.LoginAlreadyExist)); } var accountEntity = _mapper.Map <AccountModel, AccountEntity>(account); await _accountStorage.AddAsync(accountEntity); return(new Result <AccountEntity>(accountEntity)); }