using Blog.Models; using Blog.Services; using System.Linq; using Microsoft.AspNetCore.Components; namespace Blog.Components.Pages; public partial class BrpTestData : ComponentBase, IDisposable { public void Dispose() { CancellationTokenSource.Cancel(); CancellationTokenSource.Dispose(); } [Inject] public BrpService Service { get; set; } private CancellationTokenSource CancellationTokenSource { get; set; } = new CancellationTokenSource(); protected override async Task OnInitializedAsync() { this.Entries = (await Service.GetBrpEntriesAsync(CancellationTokenSource.Token) .ConfigureAwait(true)) .Where(entry => entry.bsn[0] != '1') .ToArray(); await base.OnInitializedAsync(); } private BRPEntry[] Entries { get; set; } = []; }