共用方式為


WebAssemblyRazorComponentsBuilderExtensions.AddAuthenticationStateSerialization 方法

定義

使用 PersistentComponentState 串行化伺服器端 AuthenticationStateProvider 傳回的 AuthenticationState,以便透過還原串行化用戶端 AuthenticationStateProvider,藉由從客戶端專案中呼叫 Microsoft.AspNetCore.Components.WebAssembly.Authentication 套件的 AddAuthenticationStateDeserialization 來新增。

public static Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder AddAuthenticationStateSerialization (this Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder builder, Action<Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions>? configure = default);
static member AddAuthenticationStateSerialization : Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder * Action<Microsoft.AspNetCore.Components.WebAssembly.Server.AuthenticationStateSerializationOptions> -> Microsoft.Extensions.DependencyInjection.IRazorComponentsBuilder
<Extension()>
Public Function AddAuthenticationStateSerialization (builder As IRazorComponentsBuilder, Optional configure As Action(Of AuthenticationStateSerializationOptions) = Nothing) As IRazorComponentsBuilder

參數

configure
Action<AuthenticationStateSerializationOptions>

自訂 AuthenticationState串行化的回呼。

傳回

可用來進一步自定義組態的 IRazorComponentsBuilder

適用於