public async Task RegisterNewAccountAsync(string twitterName, string mastodonName, string mastodonInstance) { //Ensure Twitter client is properly set _twitterService.EnsureTwitterIsReady(); //Create mastodon profile var appInfo = await _mastodonService.GetAppInfoAsync(mastodonInstance); var userToken = await _mastodonService.GetAccessTokenAsync(appInfo, mastodonName, mastodonInstance); var newSyncProfile = new SyncAccount { Id = Guid.NewGuid(), TwitterName = twitterName, MastodonName = mastodonName, MastodonInstance = mastodonInstance, MastodonAccessToken = userToken, LastSyncTweetId = -1 }; //Save new profil var allAccounts = _syncAccountsRepository.GetAllAccounts().ToList(); allAccounts.Add(newSyncProfile); _syncAccountsRepository.SaveAccounts(allAccounts.ToArray()); }