Exemple #1
0
        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()));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 IGroupMembership IGroupSync.AddAccount(IAccount account)
 => DefaultGroupMembership.Create(account, this, this.GetInternalSyncDataStore());
Exemple #4
0
 Task <IGroupMembership> IGroup.AddAccountAsync(IAccount account, CancellationToken cancellationToken)
 => DefaultGroupMembership.CreateAsync(account, this, this.GetInternalAsyncDataStore(), cancellationToken);