Esempio n. 1
0
        IGroupMembership IAccountSync.AddGroup(string hrefOrName)
        {
            if (string.IsNullOrEmpty(hrefOrName))
            {
                throw new ArgumentNullException(nameof(hrefOrName));
            }

            var group = this.FindGroupInDirectory(hrefOrName, this.Directory.Href);

            if (group == null)
            {
                throw new InvalidOperationException("The specified group was not found in the account's directory.");
            }

            return(DefaultGroupMembership.Create(this, group, this.GetInternalSyncDataStore()));
        }
        async Task <IGroupMembership> IAccount.AddGroupAsync(string hrefOrName, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(hrefOrName))
            {
                throw new ArgumentNullException(nameof(hrefOrName));
            }

            var group = await this.FindGroupInDirectoryAsync(hrefOrName, this.Directory.Href, cancellationToken).ConfigureAwait(false);

            if (group == null)
            {
                throw new InvalidOperationException("The specified group was not found in the account's directory.");
            }

            return(await DefaultGroupMembership.CreateAsync(this, group, this.GetInternalAsyncDataStore(), cancellationToken).ConfigureAwait(false));
        }
Esempio n. 3
0
 IGroupMembership IAccountSync.AddGroup(IGroup group)
 => DefaultGroupMembership.Create(this, group, this.GetInternalSyncDataStore());
 Task <IGroupMembership> IAccount.AddGroupAsync(IGroup group, CancellationToken cancellationToken)
 => DefaultGroupMembership.CreateAsync(this, group, this.GetInternalAsyncDataStore(), cancellationToken);