Пример #1
0
        public async Task <bool> RegisterUserAsync(RegisterUserParams registerQuery)
        {
            var newAccount = new Account
            {
                Email    = registerQuery.Email,
                Password = _cryptographyService.HashString(registerQuery.Password, registerQuery.Email)
            };

            await _accountRepository.CreateAccountAsync(newAccount);

            bool result = await _customerRepository.CreateCustomerAsync(new Customer
            {
                Account           = newAccount,
                FirstName         = registerQuery.FirstName,
                LastName          = registerQuery.LastName,
                ProfilePictureUrl =
                    "https://e7.pngegg.com/pngimages/109/994/png-clipart-teacher-student-college-school-education-avatars-child-face-thumbnail.png",
                PhoneNumber = registerQuery.PhoneNumber,
            });

            return(result);
        }
Пример #2
0
        public async Task <IActionResult> Register([FromBody] RegisterUserParams @params)
        {
            await registerUserService.RequestRegistration(@params.Email, @params.Password);

            return(ActionResponse(@params.Email));
        }