CultureInfoCache Class

Provides read-only cached instances of System.Globalization.CultureInfo.

Namespace
Microsoft.Extensions.Globalization
Assemblies
  • Microsoft.Extensions.Globalization.CultureInfoCache

Syntax

public class CultureInfoCache
class Microsoft.Extensions.Globalization.CultureInfoCache

Methods

GetCultureInfo(System.String, System.Collections.Generic.IList<System.Globalization.CultureInfo>)

Gets a read-only cached System.Globalization.CultureInfo for the specified name. Only names that exist in <em>supportedCultures</em> will be used.

Arguments:
  • name (System.String) – The culture name.
  • supportedCultures (System.Collections.Generic.IList<System.Globalization.CultureInfo>) – The cultures supported by the application.
Return type:

System.Globalization.CultureInfo

Returns:

A read-only cached System.Globalization.CultureInfo or <code>null</code> a match wasn’t found in <em>supportedCultures</em>.

public static CultureInfo GetCultureInfo(string name, IList<CultureInfo> supportedCultures)