/
ItemsProviderResult.cs
35 lines (31 loc) · 1.29 KB
/
ItemsProviderResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
namespace Microsoft.AspNetCore.Components.Web.Virtualization
{
/// <summary>
/// Represents the result of a <see cref="ItemsProviderDelegate{TItem}"/>.
/// </summary>
/// <typeparam name="TItem">The type of the context for each item in the list.</typeparam>
public readonly struct ItemsProviderResult<TItem>
{
/// <summary>
/// The items to provide.
/// </summary>
public IEnumerable<TItem> Items { get; }
/// <summary>
/// The total item count in the source generating the items provided.
/// </summary>
public int TotalItemCount { get; }
/// <summary>
/// Instantiates a new <see cref="ItemsProviderResult{TItem}"/> instance.
/// </summary>
/// <param name="items">The items to provide.</param>
/// <param name="totalItemCount">The total item count in the source generating the items provided.</param>
public ItemsProviderResult(IEnumerable<TItem> items, int totalItemCount)
{
Items = items;
TotalItemCount = totalItemCount;
}
}
}