public async Task <IdentityUserDto> Create(BaseIdentityUserCreateDto input) { var user = new IdentityUser( GuidGenerator.Create(), input.UserName, input.Email, CurrentTenant.Id ); input.MapExtraPropertiesTo(user); (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); await UpdateUserByInput(user, input); var dto = ObjectMapper.Map <IdentityUser, IdentityUserDto>(user); foreach (var id in input.JobIds) { await _userJobsRepository.InsertAsync(new UserJob(CurrentTenant.Id, user.Id, id)); } foreach (var id in input.OrganizationIds) { await _userOrgsRepository.InsertAsync(new UserOrganization(CurrentTenant.Id, user.Id, id)); } await CurrentUnitOfWork.SaveChangesAsync(); return(dto); }
public Task <IdentityUserDto> Create(BaseIdentityUserCreateDto input) { return(_userAppService.Create(input)); }