From 14473b545889539151d7cf5d8c2a58ade870af2d Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 28 Mar 2016 15:46:40 -0700 Subject: [PATCH] Return IServiceCollection from AddSession extension methods --- .../SessionServiceCollectionExtensions.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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