共用方式為


SessionServiceCollectionExtensions.AddSession 方法

定義

多載

AddSession(IServiceCollection)

新增應用程式會話狀態所需的服務。

AddSession(IServiceCollection, Action<SessionOptions>)

新增應用程式會話狀態所需的服務。

AddSession(IServiceCollection)

來源:
SessionServiceCollectionExtensions.cs
來源:
SessionServiceCollectionExtensions.cs
來源:
SessionServiceCollectionExtensions.cs

新增應用程式會話狀態所需的服務。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSession (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddSession : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSession (services As IServiceCollection) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

傳回

IServiceCollection,以便鏈結其他呼叫。

適用於

AddSession(IServiceCollection, Action<SessionOptions>)

來源:
SessionServiceCollectionExtensions.cs
來源:
SessionServiceCollectionExtensions.cs
來源:
SessionServiceCollectionExtensions.cs

新增應用程式會話狀態所需的服務。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSession (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Builder.SessionOptions> configure);
static member AddSession : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Builder.SessionOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSession (services As IServiceCollection, configure As Action(Of SessionOptions)) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

configure
Action<SessionOptions>

用來設定中介軟體的會話選項。

傳回

IServiceCollection,以便鏈結其他呼叫。

適用於