From 5bcea61743846681204d8f9a1024c8a6d2d5e7ac Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 28 Mar 2016 15:40:57 -0700 Subject: [PATCH] Return IServiceCollection from AddRouting extension methods --- .../RoutingServiceCollectionExtensions.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs index 34d84c42b8..36c7574ce3 100644 --- a/src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs @@ -19,7 +19,8 @@ namespace Microsoft.Extensions.DependencyInjection /// Adds services required for routing requests. /// /// The to add the services to. - public static void AddRouting(this IServiceCollection services) + /// The so that additional calls can be chained. + public static IServiceCollection AddRouting(this IServiceCollection services) { if (services == null) { @@ -36,6 +37,8 @@ namespace Microsoft.Extensions.DependencyInjection }); services.TryAddSingleton(typeof(RoutingMarkerService)); + + return services; } /// @@ -43,7 +46,8 @@ namespace Microsoft.Extensions.DependencyInjection /// /// The to add the services to. /// The routing options to configure the middleware with. - public static void AddRouting( + /// The so that additional calls can be chained. + public static IServiceCollection AddRouting( this IServiceCollection services, Action configureOptions) { @@ -59,6 +63,8 @@ namespace Microsoft.Extensions.DependencyInjection services.Configure(configureOptions); services.AddRouting(); + + return services; } } } \ No newline at end of file