Share via


RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<TService> Method

Definition

Saves TService state when the application is persisting state and restores it at the appropriate time automatically.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddPersistentServiceRegistration<TService>(Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.AspNetCore.Components.IComponentRenderMode componentRenderMode);
static member AddPersistentServiceRegistration : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.AspNetCore.Components.IComponentRenderMode -> Microsoft.Extensions.DependencyInjection.IServiceCollection
Public Shared Function AddPersistentServiceRegistration(Of TService) (services As IServiceCollection, componentRenderMode As IComponentRenderMode) As IServiceCollection

Type Parameters

TService

The service type to register for persistence.

Parameters

componentRenderMode
IComponentRenderMode

The IComponentRenderMode to register the service for.

Returns

The IServiceCollection.

Remarks

Only public properties annotated with PersistentStateAttribute are persisted and restored.

Applies to