【问题标题】:Get All DriveItems from Microsoft Graph SDK C#从 Microsoft Graph SDK C# 获取所有 DriveItems
【发布时间】:2020-06-23 17:45:16
【问题描述】:

我正在使用适用于 C# 的 Microsoft Graph SDK。链接如下(“https://github.com/microsoftgraph/msgraph-sdk-dotnet”)。 我用来从 SharePoint 网站获取所有项目的查询如下。

// Get Graph API Token
 GraphServiceClient client = await MicrosoftGraphClient.GetGraphServiceClient();
// Fetch all DriveItems from Sharepoint Site
 var results = await client.Sites[sharePointId].Drive.Root.ItemWithPath("SalesPortal/Presentations/" + orgnaization).Children.Request(queryOptions).GetAsync();

此查询运行良好,但仅获取前 200 条记录。我需要该路径中存在的所有记录。 提前致谢。

【问题讨论】:

    标签: c# .net .net-core microsoft-graph-api microsoft-graph-sdks


    【解决方案1】:

    根据文档:https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/collections.md#getting-a-collection
    如果要获取更多结果,您拥有的结果对象应该具有 NextPageRequest 属性。
    继续发出 NextPageRequest,随时汇总您的结果,直到它返回 null。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多