簡體   English   中英

從 Microsoft Graph SDK C# 獲取所有 DriveItems

[英]Get All DriveItems from Microsoft Graph SDK C#

我正在為 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 條記錄。 我需要該路徑中存在的所有記錄。 提前致謝。

根據文檔: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/collections.md#getting-a-collection
如果要獲取更多結果,則您擁有的結果 object 應該具有NextPageRequest屬性。
繼續發出 NextPageRequest,將結果聚合為 go,直到它返回 null。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM