public async Task <IdentityResult> RegisterUserAsync(UserForRegisterDto userForRegisterDto) { var user = _map.MapToSsuser(userForRegisterDto); user.UserStatusId = 1; var result = await _user.CreateUserAsync(user, userForRegisterDto.Password); if (!result.Succeeded) { return(result); } result = await _user.AddUserRoleOnRegisterAsync(user); return(result); }
public async Task <UserIdentityResult> CreateAsync(UserModel userModel, string password) { try { var userId = await _userData.CreateUserAsync(userModel, password); return(new UserIdentityResult { Id = userId, Succeeded = true, Errors = null }); } catch (Exception e) { return(new UserIdentityResult { Id = 0, Succeeded = false, Errors = new [] { e.Message } }); } }