共用方式為


WebAssemblyAuthenticationServiceCollectionExtensions.AddAuthenticationStateDeserialization 方法

定義

新增 AuthenticationStateProvider,其中 AuthenticationState 會使用 AuthenticationStateDataPersistentComponentState從伺服器還原串行化。 應該從伺服器專案中的 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

傳回

適用於