ylliX - Online Advertising Network

Maintaining State in Blazor Server Application

I have a Blazor server application in which I have a service registered to maintain state as follows: public class AppState { public bool IsAuthenticated { get; set; } public string UserId { get; set; } } In program.cs builder.Services.AddScoped<AppState>(); In Index.razor in OnInitialized() I set some value in AppState: @inject AppState AppState protected override […]