Class UserViewModelExtensions
- Namespace
- Dynamicweb.Ecommerce.Frontend
- Assembly
- Dynamicweb.Ecommerce.dll
Extensions for UserViewModel
public static class UserViewModelExtensions
- Inheritance
-
UserViewModelExtensions
- Inherited Members
Methods
GetStateName(UserViewModel)
Retrieves the localized name of the user's state or region based on their State and CountryCode.
public static string? GetStateName(this UserViewModel model)
Parameters
modelUserViewModelThe UserViewModel instance containing state and country information.
Returns
- string
The localized state or region name if both
StateandCountryCodeare set and the region is found; otherwise,null.
Remarks
Uses the current language context (Common.Context.LanguageID) to return the name in the appropriate language.
Falls back to null if either the state or country code is missing or invalid, or if the region cannot be resolved.
Exceptions
- ArgumentNullException
Thrown if the
modelisnull.