diff --git a/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs
index af5c9c4344..c078a12fac 100644
--- a/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs
+++ b/src/Microsoft.AspNetCore.Session/SessionServiceCollectionExtensions.cs
@@ -16,7 +16,8 @@ namespace Microsoft.Extensions.DependencyInjection
/// Adds services required for application session state.
///
/// The to add the services to.
- public static void AddSession(this IServiceCollection services)
+ /// The so that additional calls can be chained.
+ public static IServiceCollection AddSession(this IServiceCollection services)
{
if (services == null)
{
@@ -24,6 +25,7 @@ namespace Microsoft.Extensions.DependencyInjection
}
services.AddTransient();
+ return services;
}
///
@@ -31,7 +33,8 @@ namespace Microsoft.Extensions.DependencyInjection
///
/// The to add the services to.
/// The session options to configure the middleware with.
- public static void AddSession(this IServiceCollection services, Action configure)
+ /// The so that additional calls can be chained.
+ public static IServiceCollection AddSession(this IServiceCollection services, Action configure)
{
if (services == null)
{
@@ -45,6 +48,8 @@ namespace Microsoft.Extensions.DependencyInjection
services.Configure(configure);
services.AddSession();
+
+ return services;
}
}
}
\ No newline at end of file