Skip to content

Site count only includes the current page #2651

@tommysanterre

Description

@tommysanterre

Describe the bug

When fetching all of a tenant sites while using the Count = true query parameter the count only include the current page.

Expected behavior

Count should be the total across all pages. In my case 28

How to reproduce

var res = await graph.Sites.GetAllSites.GetAsGetAllSitesGetResponseAsync(request =>
{
    request.Options.WithAppOnly(tenant: tenant);
    request.QueryParameters.Top = 1;
    request.QueryParameters.Count = true;
    request.Headers.Add("ConsistencyLevel", "Eventual");
});

Console.Out.WriteLine($"Count {res.OdataCount}"); // Count 1

SDK Version

5.40

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions