RegisterPersistentComponentStateServiceCollectionExtensions.AddPersistentServiceRegistration<TService> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- services
- IServiceCollection
The IServiceCollection.
- componentRenderMode
- IComponentRenderMode
The IComponentRenderMode to register the service for.
Returns
The IServiceCollection.
Remarks
Only public properties annotated with PersistentStateAttribute are persisted and restored.