Return IServiceCollection from AddLocalization extension methods

This commit is contained in:
jacalvar 2016-03-28 15:32:13 -07:00
Родитель 6b6c658f6c
Коммит 2acc2b0a03
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -16,7 +16,8 @@ namespace Microsoft.Extensions.DependencyInjection
/// Adds services required for application localization.
/// </summary>
/// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param>
public static void AddLocalization(this IServiceCollection services)
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
public static IServiceCollection AddLocalization(this IServiceCollection services)
{
if (services == null)
{
@ -26,6 +27,8 @@ namespace Microsoft.Extensions.DependencyInjection
services.AddOptions();
AddLocalizationServices(services);
return services;
}
/// <summary>
@ -35,7 +38,8 @@ namespace Microsoft.Extensions.DependencyInjection
/// <param name="setupAction">
/// An <see cref="Action{LocalizationOptions}"/> to configure the <see cref="LocalizationOptions"/>.
/// </param>
public static void AddLocalization(
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
public static IServiceCollection AddLocalization(
this IServiceCollection services,
Action<LocalizationOptions> setupAction)
{
@ -50,6 +54,8 @@ namespace Microsoft.Extensions.DependencyInjection
}
AddLocalizationServices(services, setupAction);
return services;
}
// To enable unit testing