microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

After upgrade to Graph .NET SDK 5 with the removal of "Request()", the usageRights object is no longer available from the users[id] API

Open
#2,351 9 comments 0 reactions 1 assignee View on GitHub

@andrueastman is already working on this.

Since Mar 7, 2024.

Needs: Attention :wave: Question: SDK
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the Problem
In a ASP.NET 6 Core app, I was/am using the Graph Beta endpoint where the usageRights API is (only) available (it's been in beta for a long time).

Before the upgrade to Graph SDK 5 this code worked:

var usageRights = await _graphServiceClient.Users[user.Id].UsageRights
        .Request()
        .Filter(<my filter>)
        .GetAsync();

After upgrade to Graph SDK 5, and the removal of the Request() from the fluent API, this code does not compile:

var usageRights = await _graphServiceClient.Users[user.Id].UsageRights
         .Filter(<my filter>)
         .GetAsync();

Error CS1061'UserItemRequestBuilder' does not contain a definition for 'UsageRights' and no accessible extension method 'UsageRights' accepting a first argument of type 'UserItemRequestBuilder' could be found (are you missing a using directive or an assembly reference?)

To Reproduce

  • Install nuget Microsoft.Identity.Web.GraphServiceClientBeta
  • remove "Request()" from the Fluent API code
  • get compiler error

Expected behavior
I expect the usageRights object/API to be available like before.

Screenshots

Desktop (please complete the following information):

  • OS: Windows
  • Visual Studio 2022

Additional context
I am trying to upgrade to keep current and also use the new Retry interface but seem to be blocked now. I guess I could use the REST endpoint directly but I want to keep using the SDK for code consistency.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.