Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​AspNetCore.​Localization.​CookieRequestCultureProvider

Assembly: Microsoft.AspNetCore.Localization

Inheritance: object → RequestCultureProvider → CookieRequestCultureProvider

Implemented Interfaces

Determines the culture information for a request via the value of a cookie.

Fields and Constants

public static readonly string
DefaultCookieName
Represent the default cookie name used to track the user's preferred culture information, which is ".AspNetCore.Culture".

Properties

public string
CookieName
The name of the cookie that contains the user's preferred culture information. Defaults to <see cref="F:Microsoft.AspNetCore.Localization.CookieRequestCultureProvider.DefaultCookieName" /> .
The current options for the <see cref="T:Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware" /> .

Methods

DetermineProviderCultureResult​(Http.​HttpContext httpContext)
public static string
MakeCookieValue​(RequestCulture requestCulture)
Creates a string representation of a <see cref="T:Microsoft.AspNetCore.Localization.RequestCulture" /> for placement in a cookie.
Returns The cookie value.
requestCulture The <see cref="T:Microsoft.AspNetCore.Localization.RequestCulture" /> .
public static ProviderCultureResult
ParseCookieValue​(string value)
Parses a <see cref="T:Microsoft.AspNetCore.Localization.RequestCulture" /> from the specified cookie value. Returns <c>null</c> if parsing fails.
Returns The <see cref="T:Microsoft.AspNetCore.Localization.RequestCulture" /> or <c>null</c> if parsing fails.
value The cookie value to parse.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object