diff --git a/README.md b/README.md index 5324da41b15..1d63c745493 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,11 @@ var drive = await graphClient.Me.Drive.GetAsync(); To get the current user's root folder of their default drive: ```csharp -var rootItem = await graphClient.Me.Drive.Root.GetAsync(); +// Get the user's driveId +var drive = await graphClient.Me.Drive.GetAsync(); +var userDriveId = driveItem.Id; +// use the driveId to get the root drive +var rootItem = await graphClient.Drives[userDriveId].Root.GetAsync(); ``` `GetAsync` will return a `DriveItem` object on success and throw a diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj index b8befa590a5..a5fbdcb4937 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Test/Microsoft.Graph.DotnetCore.Test.csproj @@ -18,7 +18,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ErrorTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ErrorTests.cs index d76474dcab1..1389f830a43 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ErrorTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ErrorTests.cs @@ -11,7 +11,7 @@ public async Task ErrorThrottlingError() // To get a throttling error, I mocked up a 429 response in a text file and turned on the Fiddler // autoresponder to return the text file as the response envelope. The autoresponder for this // scenario responds to EXACT:https://graph.microsoft.com/v1.0/groups/036bd54c-c6e5-43eb-b8b5-03e019e75bd1 - ServiceException e = await Assert.ThrowsAsync(async () => await graphClient.Groups["036bd54c-c6e5-43eb-b8b5-03e019e75bd1"].GetAsync(requestConfiguration => requestConfiguration.Headers.Add("client-request-id", "dddddddd-dddd-dddd-dddd-dddddddddddd"))); + ServiceException e = await Assert.ThrowsAsync(() => graphClient.Groups["036bd54c-c6e5-43eb-b8b5-03e019e75bd1"].GetAsync(requestConfiguration => requestConfiguration.Headers.Add("client-request-id", "dddddddd-dddd-dddd-dddd-dddddddddddd"))); Assert.Contains("tooManyRetries", e.Message); } diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/CollectionReferencesRequestTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/CollectionReferencesRequestTests.cs index d137991697e..be8c84db11f 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/CollectionReferencesRequestTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/CollectionReferencesRequestTests.cs @@ -78,7 +78,7 @@ public async System.Threading.Tasks.Task AddAsync_IdRequired() ).Returns(new JsonSerializationWriter()); - await Assert.ThrowsAsync(async () => await graphServiceClient.Groups["groupId"].Members.Ref.PostAsync(userToCreate)); + await Assert.ThrowsAsync(() => graphServiceClient.Groups["groupId"].Members.Ref.PostAsync(userToCreate)); }