Skip to content

Commit

Permalink
Explain field used by example (#34151)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Nov 17, 2024
1 parent 7445076 commit 23283d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aspnetcore/blazor/components/virtualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The items provider receives an <xref:Microsoft.AspNetCore.Components.Web.Virtual

A <xref:Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize%601> component can only accept **one item source** from its parameters, so don't attempt to simultaneously use an items provider and assign a collection to `Items`. If both are assigned, an <xref:System.InvalidOperationException> is thrown when the component's parameters are set at runtime.

The following example loads employees from an `EmployeeService` (not shown):
The following example loads employees from an `EmployeeService` (not shown). The `totalEmployees` field would typically be assigned by calling a method on the same service (for example, `EmployeesService.GetEmployeesCountAsync`) elsewhere, such as during component initialization.

```csharp
private async ValueTask<ItemsProviderResult<Employee>> LoadEmployees(
Expand Down

0 comments on commit 23283d8

Please sign in to comment.