コード例 #1
0
        /// <summary>
        /// Get a list of Users asynchronously.
        /// </summary>
        /// <param name="query">The OData query.</param>
        public async Task <GraphList <User> > UserGetListAsync(ODataQuery <User> query)
        {
            var qs     = query?.ToString() ?? string.Empty;
            var result = await ExecuteRequest <ODataResponse <User> >(HttpMethod.Get, "users", qs);

            var graphList = new GraphList <User>(result.Value, result.GetSkipToken());

            return(graphList);
        }
コード例 #2
0
        /// <summary>
        /// Get a list of Applications asynchronously.
        /// </summary>
        /// <param name="query">The query.</param>
        /// <param name="top">How many items will included.</param>
        /// <param name="skipToken">The skip token (returned from a previous query if not all items were included).</param>
        public async Task <GraphList <Application> > ApplicationGetListAsync(string query = null, int?top = null, string skipToken = null)
        {
            var qs = HttpUtility.ParseQueryString(query ?? string.Empty);

            if (top != null)
            {
                qs.Add("$top", $"{top}");
            }

            if (skipToken != null)
            {
                qs.Add("$skipToken", $"X'{skipToken}'");
            }

            var result = await ExecuteRequest <ODataResponse <Application> >(HttpMethod.Get, "applications", qs.ToString());

            var graphList = new GraphList <Application>(result.Value, result.GetSkipToken());

            return(graphList);
        }