Exemplo n.º 1
0
        public async Task SendEmailActivationLinkAsync()
        {
            var identityUser = new IdentityUser(Guid.NewGuid(), "admin11", "*****@*****.**");

            identityUser.SetNewEmailConfirmationCode();
            await _userEmailer.SendEmailActivationLinkAsync(identityUser, "1233qwe");
        }
Exemplo n.º 2
0
        public async Task <IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
        {
            var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.Email, CurrentTenant.Id);

            (await _userManager.CreateAsync(user, input.Password)).CheckErrors();
            await UpdateUserByInput(user, input);

            await CurrentUnitOfWork.SaveChangesAsync();

            //Send activation email
            if (input.SendActivationEmail)
            {
                user.SetNewEmailConfirmationCode();
                await _userEmailer.SendEmailActivationLinkAsync(user, input.Password);
            }

            return(ObjectMapper.Map <IdentityUser, IdentityUserDto>(user));
        }