public async Task GenerateAsync() { try { SetGrops(); SetUsers(); _worker.UniversalEvent += (s, e) => { Console.WriteLine(e); }; await _worker.AuthorizationAsync(_config); int operationCount = await _worker.CreateGroupAsync(_groups); GenerationPercentComplete?.Invoke(this, operationCount); // await _worker.CreateUsersAsync(_users); await _worker.CreateMembersAsync(_users); } catch (Exception e) { if (e.Message.Contains("Message[Entity already exists.]")) { throw new Exception("Error creating group. The group already exists."); } throw e; } //if (GenerationPercentComplete != null) //{ // GenerationPercentComplete.Invoke(this, _users.Count); //} }