Share via


SessionServiceCollectionExtensions.AddSession Method

Definition

Overloads

AddSession(IServiceCollection)

Adds services required for application session state.

AddSession(IServiceCollection, Action<SessionOptions>)

Adds services required for application session state.

AddSession(IServiceCollection)

Source:
SessionServiceCollectionExtensions.cs
Source:
SessionServiceCollectionExtensions.cs
Source:
SessionServiceCollectionExtensions.cs

Adds services required for application session state.

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

Parameters

services
IServiceCollection

The IServiceCollection to add the services to.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to

AddSession(IServiceCollection, Action<SessionOptions>)

Source:
SessionServiceCollectionExtensions.cs
Source:
SessionServiceCollectionExtensions.cs
Source:
SessionServiceCollectionExtensions.cs

Adds services required for application session state.

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

Parameters

services
IServiceCollection

The IServiceCollection to add the services to.

configure
Action<SessionOptions>

The session options to configure the middleware with.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to