diff --git a/src/Microsoft.AspNetCore.Cors/CorsServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Cors/CorsServiceCollectionExtensions.cs index a37681f8d4..430621d2fd 100644 --- a/src/Microsoft.AspNetCore.Cors/CorsServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.Cors/CorsServiceCollectionExtensions.cs @@ -16,7 +16,8 @@ namespace Microsoft.Extensions.DependencyInjection /// Adds cross-origin resource sharing services to the specified . /// /// The to add services to. - public static void AddCors(this IServiceCollection services) + /// The so that additional calls can be chained. + public static IServiceCollection AddCors(this IServiceCollection services) { if (services == null) { @@ -27,6 +28,8 @@ namespace Microsoft.Extensions.DependencyInjection services.TryAdd(ServiceDescriptor.Transient()); services.TryAdd(ServiceDescriptor.Transient()); + + return services; } /// @@ -34,7 +37,8 @@ namespace Microsoft.Extensions.DependencyInjection /// /// The to add services to. /// An to configure the provided . - public static void AddCors(this IServiceCollection services, Action setupAction) + /// The so that additional calls can be chained. + public static IServiceCollection AddCors(this IServiceCollection services, Action setupAction) { if (services == null) { @@ -48,6 +52,8 @@ namespace Microsoft.Extensions.DependencyInjection services.AddCors(); services.Configure(setupAction); + + return services; } } } \ No newline at end of file