Skip to content

Commit bc193d4

Browse files
authored
Merge pull request #2186 from microsoftgraph/andrueastman-patch-1
Update README.md to capture missing drive path
2 parents 8a414b0 + 6143a9d commit bc193d4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ var drive = await graphClient.Me.Drive.GetAsync();
5858
To get the current user's root folder of their default drive:
5959

6060
```csharp
61-
var rootItem = await graphClient.Me.Drive.Root.GetAsync();
61+
// Get the user's driveId
62+
var drive = await graphClient.Me.Drive.GetAsync();
63+
var userDriveId = driveItem.Id;
64+
// use the driveId to get the root drive
65+
var rootItem = await graphClient.Drives[userDriveId].Root.GetAsync();
6266
```
6367

6468
`GetAsync` will return a `DriveItem` object on success and throw a

0 commit comments

Comments
 (0)