SessionServiceCollectionExtensions.AddSession Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 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>)
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.