コード例 #1
0
ファイル: LoginService.cs プロジェクト: Allen-Glass/ToolShed
        public async Task CreateNewAccountAsync(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            var userEmailAlreadyExist = await userSQLService.CheckIfUserEmailExists(user.Email);

            if (userEmailAlreadyExist)
            {
                throw new Exception(); //create new exception
            }

            user.Password = HashUserPassword(user.Password);

            await userSQLService.CreateNewUserAccountAsync(user);
        }