WebAssemblyAuthenticationServiceCollectionExtensions.AddAuthenticationStateDeserialization 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增 AuthenticationStateProvider,其中 AuthenticationState 會使用 AuthenticationStateData 和 PersistentComponentState從伺服器還原串行化。 應該從伺服器專案中的 Microsoft.AspNetCore.Components.WebAssembly.Server 套件呼叫 AddAuthenticationStateSerialization。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthenticationStateDeserialization (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthenticationStateDeserializationOptions>? configure = default);
static member AddAuthenticationStateDeserialization : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthenticationStateDeserializationOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAuthenticationStateDeserialization (services As IServiceCollection, Optional configure As Action(Of AuthenticationStateDeserializationOptions) = Nothing) As IServiceCollection
參數
- services
- IServiceCollection
要加入服務的 IServiceCollection。
- configure
- Action<AuthenticationStateDeserializationOptions>