27 lines
806 B
C#
27 lines
806 B
C#
|
using BootstrapBlazor.Components;
|
|||
|
using Microsoft.AspNetCore.Components;
|
|||
|
using Microsoft.Extensions.Localization;
|
|||
|
using System.Collections.Concurrent;
|
|||
|
using System.Diagnostics.CodeAnalysis;
|
|||
|
using UI.Data;
|
|||
|
|
|||
|
namespace UI.Components.Pages {
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
public partial class TableDemo : ComponentBase {
|
|||
|
[Inject]
|
|||
|
[NotNull]
|
|||
|
private IStringLocalizer<Foo>? Localizer { get; set; }
|
|||
|
|
|||
|
private readonly ConcurrentDictionary<Foo, IEnumerable<SelectedItem>> _cache = new();
|
|||
|
|
|||
|
private IEnumerable<SelectedItem> GetHobbys(Foo item) => _cache.GetOrAdd(item, f => Foo.GenerateHobbys(Localizer));
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
private static IEnumerable<int> PageItemsSource => new int[] { 20, 40 };
|
|||
|
}
|
|||
|
}
|