IGroupMembership IGroupSync.AddAccount(string hrefOrEmailOrUsername) { if (string.IsNullOrEmpty(hrefOrEmailOrUsername)) { throw new ArgumentNullException(nameof(hrefOrEmailOrUsername)); } var account = this.FindAccount(hrefOrEmailOrUsername); if (account == null) { throw new InvalidOperationException($"No matching account for {nameof(hrefOrEmailOrUsername)} '{hrefOrEmailOrUsername}' found."); } return(DefaultGroupMembership.Create(account, this, this.GetInternalSyncDataStore())); }
async Task <IGroupMembership> IGroup.AddAccountAsync(string hrefOrEmailOrUsername, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(hrefOrEmailOrUsername)) { throw new ArgumentNullException(nameof(hrefOrEmailOrUsername)); } var account = await this.FindAccountAsync(hrefOrEmailOrUsername, cancellationToken).ConfigureAwait(false); if (account == null) { throw new InvalidOperationException($"No matching account for {nameof(hrefOrEmailOrUsername)} '{hrefOrEmailOrUsername}' found."); } return(await DefaultGroupMembership.CreateAsync(account, this, this.GetInternalAsyncDataStore(), cancellationToken).ConfigureAwait(false)); }
IGroupMembership IGroupSync.AddAccount(IAccount account) => DefaultGroupMembership.Create(account, this, this.GetInternalSyncDataStore());
Task <IGroupMembership> IGroup.AddAccountAsync(IAccount account, CancellationToken cancellationToken) => DefaultGroupMembership.CreateAsync(account, this, this.GetInternalAsyncDataStore(), cancellationToken);