WebAssemblyRazorComponentsBuilderExtensions.AddAuthenticationStateSerialization 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用 PersistentComponentState 通过反序列化客户端 AuthenticationStateProvider 序列化服务器端 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。