With Opticon around the corner, we'll be canceling this month's (Sept) Happy Hour.

Class LocalizationServiceCollectionExtensions

Provides extension methods for Microsoft.Extensions.DependencyInjection.IServiceCollection implemenations.

Inheritance
System.Object
LocalizationServiceCollectionExtensions
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public static class LocalizationServiceCollectionExtensions : Object

Methods

AddEmbeddedLocalization<TAssembly>(IServiceCollection)

Adds embedded localizations from the given System.Reflection.Assembly to the LocalizationService.

Declaration
public static IServiceCollection AddEmbeddedLocalization<TAssembly>(this IServiceCollection services)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services

The service collection.

Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection

The service configuration provider

Type Parameters
Name Description
TAssembly

A type in the System.Reflection.Assembly which contains embedded localization to be added.

AddLocalizationProvider<TProvider>(IServiceCollection)

Adds a localization provider to the CMS localization system.

Declaration
public static IServiceCollection AddLocalizationProvider<TProvider>(this IServiceCollection services)
    where TProvider : LocalizationProvider
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services

The service collection.

Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection

The service configuration provider

Type Parameters
Name Description
TProvider

The type of LocalizationProvider to add.

AddLocalizationProvider<TProvider, TProviderOptions>(IServiceCollection, Action<TProviderOptions>)

Adds a localization provider to the cms localization system.

Declaration
public static IServiceCollection AddLocalizationProvider<TProvider, TProviderOptions>(this IServiceCollection services, Action<TProviderOptions> configure)
    where TProvider : LocalizationProvider where TProviderOptions : class, new()
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection services

The service collection.

System.Action<TProviderOptions> configure

The method used to setup the provider options.

Returns
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection

The service configuration provider

Type Parameters
Name Description
TProvider

The type of LocalizationProvider to add.

TProviderOptions

The type of the options class used to configure the LocalizationProvider.