Class ViewComponentExtensions
Contains extension methods for the ViewComponent class to retrieve culture and language information from the current ViewContext.
Inheritance
object
ViewComponentExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DataWeb.Mvc
Assembly: DataWeb.Core.dll
Syntax
public static class ViewComponentExtensions
Methods
GetCulture(ViewComponent)
Returns the culture value from the current ViewContext of the specified component
.
Declaration
public static string GetCulture(this ViewComponent component)
Parameters
Type | Name | Description |
---|---|---|
ViewComponent | component | The Microsoft.AspNetCore.Mvc.ViewComponent instance. |
Returns
Type | Description |
---|---|
string | The culture value as a string". |
GetLanguage(ViewComponent)
Returns the language value from the current ViewContext of the specified component
.
Declaration
public static string GetLanguage(this ViewComponent component)
Parameters
Type | Name | Description |
---|---|---|
ViewComponent | component | The Microsoft.AspNetCore.Mvc.ViewComponent instance. |
Returns
Type | Description |
---|---|
string | The language value as a string. |