WebAssemblyRazorComponentsBuilderExtensions.AddAuthenticationStateSerialization 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用 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。