Sakura.AspNetCore.Extensions/Sakura.AspNetCore.DynamicLocalizer/ServiceCollectionExtensions.cs
/// <summary>
///     Add default implementation for all dynamic resource accessing services.
/// </summary>
/// <param name="services">The service collection container.</param>
Add default implementation for all dynamic resource accessing services.
Add default implementation for all dynamic resource accessing services .
public static void AddDynamicLocalizer([NotNull] this IServiceCollection services)
		{
			if (services == null)
				throw new ArgumentNullException(nameof(services));
			services.TryAddTransient<IDynamicViewLocalizer, DynamicViewLocalizer>();
			services.TryAddTransient(typeof(IDynamicStringLocalizer<>), typeof(DynamicStringLocalizer<>));
			services.TryAddTransient(typeof(IDynamicHtmlLocalizer<>), typeof(DynamicHtmlLocalizer<>));
		}
public static void AddDynamicLocalizer ( [ NotNull ] this IServiceCollection services ) { if ( services == null ) throw new ArgumentNullException ( nameof ( services ) ) ; services . TryAddTransient < IDynamicViewLocalizer , DynamicViewLocalizer > ( ) ; services . TryAddTransient ( typeof ( IDynamicStringLocalizer < > ) , typeof ( DynamicStringLocalizer < > ) ) ; services . TryAddTransient ( typeof ( IDynamicHtmlLocalizer < > ) , typeof ( DynamicHtmlLocalizer < > ) ) ; }
Add default implementation for all dynamic resource accessing services.
Add default implementation for all dynamic resource accessing services .
this
[NotNull]
services
The service collection container.
The service collection container .