Код: Выделить всё
@inject IRecordServices RecordServices
@inject DialogService DialogService
@inject IJSRuntime js
@inject Radzen.NotificationService NotificationService
@inject PersistentComponentState ApplicationState
@rendermode InteractiveServer
..............DataGrid populated with records...............
IEnumerable? records;
RadzenDataGrid grid = new RadzenDataGrid();
PersistingComponentStateSubscription rendering;
protected override async Task OnInitializedAsync()
{
rendering = ApplicationState.RegisterOnPersisting(PersistState);
var foundInState = ApplicationState.TryTakeFromJson("records", out var records);
records = foundInState ? records : await GetAllRecordsForGrid();
}
private async Task GetAllRecordsForGrid()
{
return await RecordServices.GetRecordEntities();
}
private Task PersistState()
{
ApplicationState.PersistAsJson("records", records);
return Task.CompletedTask;
}
Код: Выделить всё
builder.Services.AddMemoryCache();
Код: Выделить всё

Однако, когда я добираюсь до PersistState(), записи всегда имеют значение null:
[img]https://i.sstatic.net /51fZSaHO.png[/img]
Что я делаю не так?
Подробнее здесь: https://stackoverflow.com/questions/791 ... en-renders