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)

Adds services required for application session state.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSession(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
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

IServiceCollection

The IServiceCollection so that additional calls can be chained.

Applies to

AddSession(IServiceCollection, Action<SessionOptions>)

Adds services required for application session state.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSession(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::AspNetCore::Builder::SessionOptions ^> ^ configure);
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

IServiceCollection

The IServiceCollection so that additional calls can be chained.

Applies to