1 instantiation of PersistentComponentState
Microsoft.AspNetCore.Components (1)
Infrastructure\ComponentStatePersistenceManager.cs (1)
25State = new PersistentComponentState(_currentState, _registeredCallbacks);
48 references to PersistentComponentState
BasicTestApp (2)
PreserveStateService.cs (2)
11private readonly PersistentComponentState _componentApplicationState; 16public PreserveStateService(PersistentComponentState componentApplicationState)
Microsoft.AspNetCore.Components (2)
Infrastructure\ComponentStatePersistenceManager.cs (1)
32public PersistentComponentState State { get; }
PersistentComponentState.cs (1)
94/// and removed from the <see cref="PersistentComponentState"/>.
Microsoft.AspNetCore.Components.Endpoints (6)
DependencyInjection\RazorComponentsServiceCollectionExtensions.cs (1)
65services.TryAddScoped<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
Forms\EndpointAntiforgeryStateProvider.cs (1)
10internal class EndpointAntiforgeryStateProvider(IAntiforgery antiforgery, PersistentComponentState state) : DefaultAntiforgeryStateProvider(state)
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (2)
18Justification = $"{nameof(DefaultAntiforgeryStateProvider)} uses the {nameof(PersistentComponentState)} APIs to deserialize the token, which are already annotated.")] 19public DefaultAntiforgeryStateProvider(PersistentComponentState state)
src\Components\Shared\src\ResourceCollectionProvider.cs (2)
17private readonly PersistentComponentState _state; 21public ResourceCollectionProvider(PersistentComponentState state, IJSRuntime jsRuntime)
Microsoft.AspNetCore.Components.Endpoints.Tests (13)
EndpointHtmlRendererTest.cs (12)
1269var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1323var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1361var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1391var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1456var state = httpContext.RequestServices.GetRequiredService<PersistentComponentState>(); 1592[Inject] public PersistentComponentState State { get; set; } 1680services.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
RazorComponentResultTest.cs (1)
467.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State)
Microsoft.AspNetCore.Components.Server (2)
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (2)
18Justification = $"{nameof(DefaultAntiforgeryStateProvider)} uses the {nameof(PersistentComponentState)} APIs to deserialize the token, which are already annotated.")] 19public DefaultAntiforgeryStateProvider(PersistentComponentState state)
Microsoft.AspNetCore.Components.Tests (9)
Lifetime\ComponentApplicationStateTest.cs (9)
14var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), new List<PersistComponentStateRegistration>()); 32var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), new List<PersistComponentStateRegistration>()); 48var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), new List<PersistComponentStateRegistration>()); 68var applicationState = new PersistentComponentState(currentState, new List<PersistComponentStateRegistration>()) 87var applicationState = new PersistentComponentState(currentState, new List<PersistComponentStateRegistration>()) 104var applicationState = new PersistentComponentState(currentState, new List<PersistComponentStateRegistration>()) 123var applicationState = new PersistentComponentState(currentState, new List<PersistComponentStateRegistration>()) 143var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), new List<PersistComponentStateRegistration>()); 161var applicationState = new PersistentComponentState(new Dictionary<string, byte[]>(), new List<PersistComponentStateRegistration>());
Microsoft.AspNetCore.Components.Web (2)
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (2)
18Justification = $"{nameof(DefaultAntiforgeryStateProvider)} uses the {nameof(PersistentComponentState)} APIs to deserialize the token, which are already annotated.")] 19public DefaultAntiforgeryStateProvider(PersistentComponentState state)
Microsoft.AspNetCore.Components.WebAssembly (5)
Hosting\WebAssemblyHostBuilder.cs (1)
307Services.AddSingleton<PersistentComponentState>(sp => sp.GetRequiredService<ComponentStatePersistenceManager>().State);
src\Components\Shared\src\DefaultAntiforgeryStateProvider.cs (2)
18Justification = $"{nameof(DefaultAntiforgeryStateProvider)} uses the {nameof(PersistentComponentState)} APIs to deserialize the token, which are already annotated.")] 19public DefaultAntiforgeryStateProvider(PersistentComponentState state)
src\Components\Shared\src\ResourceCollectionProvider.cs (2)
17private readonly PersistentComponentState _state; 21public ResourceCollectionProvider(PersistentComponentState state, IJSRuntime jsRuntime)
Microsoft.AspNetCore.Components.WebAssembly.Server (7)
AuthenticationStateSerializationOptions.cs (2)
12/// to the WebAssembly client using <see cref="PersistentComponentState"/>. 32/// for JSON serialization to the client using <see cref="PersistentComponentState"/>."/>
AuthenticationStateSerializer.cs (4)
15private readonly PersistentComponentState _state; 21public AuthenticationStateSerializer(PersistentComponentState persistentComponentState, IOptions<AuthenticationStateSerializationOptions> options) 32throw new InvalidOperationException($"{nameof(SetAuthenticationState)} must be called before the {nameof(PersistentComponentState)}.{nameof(PersistentComponentState.RegisterOnPersisting)} callback.");
WebAssemblyRazorComponentsBuilderExtensions.cs (1)
32/// Serializes the <see cref="AuthenticationState"/> returned by the server-side <see cref="AuthenticationStateProvider"/> using <see cref="PersistentComponentState"/>