Open gmantri opened 3 years ago
This is a service bug. I would've expected a nextlink in the response payload. It doesn't appear that paging is supported with this API. I used the PageIterator to test this.
static async Task GetAppRoleAssignments(GraphServiceClient client)
{
var graphResponse = await client.Users[Chambele.V1.user].AppRoleAssignments.Request().GetResponseAsync();
var response = await graphResponse.GetResponseObjectAsync();
List<string> results = new();
// Create the callback to process each entity returned in the pages
Func<AppRoleAssignment, bool> processEachEvent = (a) =>
{
bool shouldContinue = true;
results.Add(a.ResourceDisplayName);
return shouldContinue;
};
// Create the iterator with the specified type
var appRoleAssignmentPageIterator = PageIterator<AppRoleAssignment>.CreatePageIterator(client,
response.Value,
processEachEvent);
await appRoleAssignmentPageIterator.IterateAsync();
results.Dump();
}
@MIchaelMainer - Thank you for looking into this. It is very much appreciated. Considering this is a service bug, do I need to report it someplace else as well? Should I keep this issue open? Please let me know.
Thanks
We'll keep this issue open. Thank you.
Thank you for reporting this issue. This appears to be an issue or limitation with the service APIs. Unfortunately, as the Microsoft Graph SDK team, we do not have ownership of the APIs that are causing you issues. We invite you to create a question about the service API to Microsoft Q&A and tagged with one of the [microsoft-graph-*] tags, that way it will get routed to the appropriate team for them to triage:
https://aka.ms/msgraphsupport or directly https://aka.ms/askgraph
For now, we will close the issue on our side but feel free to open it in the relevant repository if you think the issue is specific to SDK. Please let us know if this helps!
Note: We will close this repository on April 19, 2024.
Describe the bug I am trying to get app role assignments for a user. A user can be assigned many app roles and I want to implement some kind of pagination there. Let's say my user has 10 app role assignments and I want to fetch 5 app role assignments at a time. When I specify
$top
as5
, I get the first 5 roles (which is correct) however I am expecting to get backnext page request
which is coming as null.Please see my sample code below:
Because of this, I only get first 5 role assignments back.
Is this a bug in the SDK or does this operation not support pagination?
Additional context I am using
Microsoft.Graph (version 4.0.0-preview.6
Nuget package.AB#10091