Example #1
0
        internal FindEntityResults(PageResponseCollection <T> response)
        {
            foreach (T item in response.Value)
            {
                this.ResultsCollection.Add(item);
            }

            this.MoreAvailable = response.HasNextLink;
        }
        /// <summary>
        /// Create new instance of <see cref="FindContactFolderResults"/>
        /// </summary>
        internal FindContactFolderResults(PageResponseCollection <ContactFolder> responseCollection)
        {
            responseCollection.ThrowIfNull(nameof(responseCollection));
            foreach (ContactFolder contactFolder in responseCollection.Value)
            {
                this.ContactFolders.Add(contactFolder);
            }

            this.MoreAvailable = responseCollection.HasNextLink;
        }
Example #3
0
        /// <summary>
        /// Create new instance of <see cref="FindMailFolderResults"/>
        /// </summary>
        internal FindMailFolderResults(PageResponseCollection <MailFolder> responseCollection)
        {
            responseCollection.ThrowIfNull(nameof(responseCollection));
            foreach (MailFolder mailFolder in responseCollection.Value)
            {
                this.MailFolders.Add(mailFolder);
            }

            this.MoreAvailable = responseCollection.HasNextLink;
        }
        /// <summary>
        /// Find item results.
        /// </summary>
        internal FindItemResults(PageResponseCollection <T> pageResponseCollection)
            : base()
        {
            pageResponseCollection.ThrowIfNull(nameof(pageResponseCollection));
            foreach (T item in pageResponseCollection.Value)
            {
                this.Items.Add(item);
            }

            this.MoreAvailable = pageResponseCollection.HasNextLink;
        }
Example #5
0
        /// <summary>
        /// Create new instance of <see cref="SyncStateQuery{T}"/>
        /// </summary>
        /// <param name="pageResponseCollection"></param>
        internal SyncStateQuery(PageResponseCollection <T> pageResponseCollection)
        {
            pageResponseCollection.ThrowIfNull(nameof(pageResponseCollection));
            if (pageResponseCollection.HasDeltaLink)
            {
                this.Initialize(
                    pageResponseCollection.DeltaLink,
                    TokenType.DeltaToken);
            }

            else if (pageResponseCollection.HasNextLink)
            {
                this.Initialize(
                    pageResponseCollection.NextLink,
                    TokenType.SkipToken);
            }

            else
            {
                throw new ArgumentException("Page response doesn't contain paging link.");
            }
        }