RequestCulture Class

Details about the culture for an Microsoft.AspNetCore.Http.HttpRequest.

Namespace
Microsoft.AspNetCore.Localization
Assemblies
  • Microsoft.AspNetCore.Localization

Syntax

public class RequestCulture
class Microsoft.AspNetCore.Localization.RequestCulture

Constructors

RequestCulture(System.Globalization.CultureInfo)

Creates a new Microsoft.AspNetCore.Localization.RequestCulture object has its Microsoft.AspNetCore.Localization.RequestCulture.Culture and Microsoft.AspNetCore.Localization.RequestCulture.UICulture properties set to the same System.Globalization.CultureInfo value.

Arguments:culture (System.Globalization.CultureInfo) – The System.Globalization.CultureInfo for the request.
public RequestCulture(CultureInfo culture)
RequestCulture(System.Globalization.CultureInfo, System.Globalization.CultureInfo)

Creates a new Microsoft.AspNetCore.Localization.RequestCulture object has its Microsoft.AspNetCore.Localization.RequestCulture.Culture and Microsoft.AspNetCore.Localization.RequestCulture.UICulture properties set to the respective System.Globalization.CultureInfo values provided.

Arguments:
  • culture (System.Globalization.CultureInfo) – The System.Globalization.CultureInfo for the request to be used for formatting.
  • uiCulture (System.Globalization.CultureInfo) – The System.Globalization.CultureInfo for the request to be used for text, i.e. language.
public RequestCulture(CultureInfo culture, CultureInfo uiCulture)
RequestCulture(System.String)

Creates a new Microsoft.AspNetCore.Localization.RequestCulture object has its Microsoft.AspNetCore.Localization.RequestCulture.Culture and Microsoft.AspNetCore.Localization.RequestCulture.UICulture properties set to the same System.Globalization.CultureInfo value.

Arguments:culture (System.String) – The culture for the request.
public RequestCulture(string culture)
RequestCulture(System.String, System.String)

Creates a new Microsoft.AspNetCore.Localization.RequestCulture object has its Microsoft.AspNetCore.Localization.RequestCulture.Culture and Microsoft.AspNetCore.Localization.RequestCulture.UICulture properties set to the respective System.Globalization.CultureInfo values provided.

Arguments:
  • culture (System.String) – The culture for the request to be used for formatting.
  • uiCulture (System.String) – The culture for the request to be used for text, i.e. language.
public RequestCulture(string culture, string uiCulture)

Properties

Microsoft.AspNetCore.Localization.RequestCulture.Culture

Gets the System.Globalization.CultureInfo for the request to be used for formatting.

Return type:System.Globalization.CultureInfo
public CultureInfo Culture { get; }
Microsoft.AspNetCore.Localization.RequestCulture.UICulture

Gets the System.Globalization.CultureInfo for the request to be used for text, i.e. language;

Return type:System.Globalization.CultureInfo
public CultureInfo UICulture { get; }