Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

origin of 'totalEmployees' variable in code example not clear #34149

Closed
NikolaJacques opened this issue Nov 17, 2024 · 2 comments · Fixed by #34151
Closed

origin of 'totalEmployees' variable in code example not clear #34149

NikolaJacques opened this issue Nov 17, 2024 · 2 comments · Fixed by #34151

Comments

@NikolaJacques
Copy link

NikolaJacques commented Nov 17, 2024

Description

Not sure whether this is an issue or not, but in the code example below I noticed that a 'totalEmployees' variable is used, which I cannot gather from context where it comes from / where it gets its value:

private async ValueTask<ItemsProviderResult<Employee>> LoadEmployees(
    ItemsProviderRequest request)
{
    var numEmployees = Math.Min(request.Count, **totalEmployees** - request.StartIndex);
    var employees = await EmployeesService.GetEmployeesAsync(request.StartIndex, 
        numEmployees, request.CancellationToken);

    return new ItemsProviderResult<Employee>(employees, **totalEmployees**);
}

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/virtualization?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/virtualization.md

Document ID

26ed2425-63ec-e206-edcb-e51f17edb844

Article author

@guardrex

Related Issues

Copy link
Contributor

🍂🎃🏮 Autumn Skies and Pumpkin Pies! 🥧☕🍂

Stand by! A green dinosaur 🦖 will arrive shortly to assist.

@guardrex
Copy link
Collaborator

guardrex commented Nov 17, 2024

Hello @NikolaJacques ... It would be pulled from the service (probably) and assigned to that field via a method call elsewhere in the component, such as during initialization. I'll make a remark for that example. Leave this issue open, as it will close automatically when the PR merges later. Thanks for the issue!

@guardrex guardrex moved this from Triage to P3 - Low Priority in Blazor.Docs Nov 17, 2024
@guardrex guardrex moved this from P3 - Low Priority to In progress in Blazor.Docs Nov 17, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Blazor.Docs Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants