Пример #1
0
        public async Task <(Result Result, string id)> CreateHrAsync(HrSignupCommand HrSignUp)
        {
            var user = new ApplicationUser
            {
                Name        = HrSignUp.Name,
                PhoneNumber = HrSignUp.PhoneNumber,
                Email       = HrSignUp.Email,
                UserName    = HrSignUp.Email,
                UserType    = UserType.HR,
            };
            var result = await _userManager.CreateAsync(user, HrSignUp.Password);

            string userId = null;

            if (result.Succeeded)
            {
                userId = user.Id;
                await _userManager.AddToRoleAsync(user, UserType.HR.ToString());
            }
            return(result.ToApplicationResult(), userId);
        }
 public async Task <HrSignupResult> UserSignUp(HrSignupCommand command)
 {
     return(await Mediator.Send(command));
 }