Table of Contents

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

model UserViewModel

The UserViewModel instance containing state and country information.

Returns

string

The localized state or region name if both State and CountryCode are 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 model is null.

To top