File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
BlazorSample_BlazorWebApp/Components/Pages
BlazorWebAppOidc/BlazorWebAppOidc.Client/Pages Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 2121 ApplicationState .RegisterOnPersisting (PersistCount );
2222
2323 if (! ApplicationState .TryTakeFromJson <int >(
24- " count " , out var restoredCount ))
24+ nameof ( currentCount ) , out var restoredCount ))
2525 {
2626 currentCount = Random .Shared .Next (100 );
2727 Logger .LogInformation (" currentCount set to {Count}" , currentCount );
3535
3636 private Task PersistCount ()
3737 {
38- ApplicationState .PersistAsJson (" count " , currentCount );
38+ ApplicationState .PersistAsJson (nameof ( currentCount ) , currentCount );
3939
4040 return Task .CompletedTask ;
4141 }
Original file line number Diff line number Diff line change 4949 {
5050 persistingSubscription = ApplicationState .RegisterOnPersisting (PersistData );
5151
52- if (! ApplicationState .TryTakeFromJson <IEnumerable <WeatherForecast >>(" data " , out var restoredData ))
52+ if (! ApplicationState .TryTakeFromJson <IEnumerable <WeatherForecast >>(nameof ( forecasts ) , out var restoredData ))
5353 {
5454 forecasts = await WeatherForecaster .GetWeatherForecastAsync ();
5555 }
6161
6262 private Task PersistData ()
6363 {
64- ApplicationState .PersistAsJson (" data " , forecasts );
64+ ApplicationState .PersistAsJson (nameof ( forecasts ) , forecasts );
6565
6666 return Task .CompletedTask ;
6767 }
You can’t perform that action at this time.
0 commit comments