/// <inheritdoc /> public async Task <User> CreateAccountAsync(User account) { if (account == null) { throw new ArgumentNullException(nameof(account)); } account.Password = BCrypt.Net.BCrypt.HashPassword(account.Password); account.CreatedOn = DateTime.Now; account.LastLogon = DateTime.Now; account = await _userDomainService.CreateUserAsync(account); account.AccessToken = await this._tokenDomainService.GenerateTokenForUserAsync(account.Id); return(account); }